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.
This commit is contained in:
nevaforget committed 2026-09-01 19:33:49 +02:00
1 parent a85f89ff1b
commit 95e502e60a
1 file changed
+16 -6
+16 -6
View File
@@ -123,12 +123,22 @@
partOf = [ "graphical-session.target" ]; partOf = [ "graphical-session.target" ];
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
# stasis runs the configured actions as `sh -lc`, so those resolve through # Every binary a configured action names has to be listed here. stasis does
# /etc/profile and need nothing here beyond a shell to start. niri, pactl # not run the actions through a login shell, so /etc/profile never applies
# and notify-send it spawns directly, past the shell, and pactl is why # and nothing resolves via /run/current-system/sw/bin. A missing binary is
# pulseaudio appears at all — it stays off systemPackages, see # silent: the spawn fails, stasis logs the action as started, sees the
# modules/desktop.nix. # immediate exit, treats the step as finished and stops there — which is how
path = with pkgs; [ bashNonInteractive niri pulseaudio libnotify ]; # 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 = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = "${lib.getExe pkgs.stasis}"; ExecStart = "${lib.getExe pkgs.stasis}";