From 2365918156e639424f52e06ee6b3e409188b7354 Mon Sep 17 00:00:00 2001 From: Vegard Bieker Matthey Date: Mon, 14 Sep 2026 23:20:35 +0200 Subject: [PATCH] nixos/dwl: fix systemd environment imports Assisted-by: Claude Sonnet 5 --- nixos/modules/programs/wayland/dwl.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nixos/modules/programs/wayland/dwl.nix b/nixos/modules/programs/wayland/dwl.nix index 5e3ac932b212..792166066672 100644 --- a/nixos/modules/programs/wayland/dwl.nix +++ b/nixos/modules/programs/wayland/dwl.nix @@ -61,11 +61,10 @@ in #!${pkgs.runtimeShell} # Import environment variables ${cfg.extraSessionCommands} - # Setup systemd user environment - systemctl --user import-environment DISPLAY WAYLAND_DISPLAY - systemctl --user start dwl-session.target - # Start dwl - exec ${lib.getExe cfg.package} + # Start dwl, then set up the systemd user environment once dwl + # has actually set WAYLAND_DISPLAY (see dwl(1) -s), instead of + # importing it before dwl exists. + exec ${lib.getExe cfg.package} -s "systemctl --user import-environment DISPLAY WAYLAND_DISPLAY; systemctl --user start dwl-session.target" ''; mode = "0755"; # Make it executable };