From 95e502e60a2e02f7826888a78353cb4e1ceb59ff Mon Sep 17 00:00:00 2001 From: nevaforget <> Date: Tue, 1 Sep 2026 19:33:41 +0200 Subject: [PATCH] fix(stasis): put swaylock and brightnessctl on the unit PATH stasis does not run the configured actions through a login shell, so /etc/profile never applies and nothing resolves via /run/current-system/sw/bin. The old comment claimed the opposite and listed only the binaries stasis spawns directly, which left swaylock unreachable: `niri msg` worked, so the chain looked healthy while the lock step never ran. The failure is silent. The spawn fails, stasis logs the action as started, sees the immediate exit, treats the step as finished and stops there -- the daemon then sits in "waiting for idle" with no lock and no dpms. Verified: with an absolute path in the config, `stasis trigger lock_screen` locks; with a bare `swaylock` and the old PATH it exits instantly. brightnessctl comes along for the laptop's brightness step, which has the same problem. --- modules/services.nix | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/services.nix b/modules/services.nix index ce2f961..aaf50c1 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -123,12 +123,22 @@ partOf = [ "graphical-session.target" ]; after = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ]; - # stasis runs the configured actions as `sh -lc`, so those resolve through - # /etc/profile and need nothing here beyond a shell to start. niri, pactl - # and notify-send it spawns directly, past the shell, and pactl is why - # pulseaudio appears at all — it stays off systemPackages, see - # modules/desktop.nix. - path = with pkgs; [ bashNonInteractive niri pulseaudio libnotify ]; + # Every binary a configured action names has to be listed here. stasis does + # not run the actions through a login shell, so /etc/profile never applies + # and nothing resolves via /run/current-system/sw/bin. A missing binary is + # silent: the spawn fails, stasis logs the action as started, sees the + # immediate exit, treats the step as finished and stops there — which is how + # swaylock was absent for the whole idle chain while `niri msg` worked. + # pactl is why pulseaudio appears at all — it stays off systemPackages, see + # modules/desktop.nix. brightnessctl is for the laptop's brightness step. + path = with pkgs; [ + bashNonInteractive + niri + pulseaudio + libnotify + swaylock + brightnessctl + ]; serviceConfig = { Type = "simple"; ExecStart = "${lib.getExe pkgs.stasis}";