swayidle: fix systemd service
swayidle executes commands using "sh -c" and so its PATH must contain a shell. This adds such PATH entry to the environment of the systemd service. Fixes #2811.
This commit is contained in:
parent
6311f4adc3
commit
43ea4c5123
|
@ -108,6 +108,8 @@ in {
|
|||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
# swayidle executes commands using "sh -c", so the PATH needs to contain a shell.
|
||||
Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ];
|
||||
ExecStart =
|
||||
"${cfg.package}/bin/swayidle -w ${concatStringsSep " " args}";
|
||||
};
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
|
||||
assertFileExists $serviceFile
|
||||
assertFileRegex $serviceFile 'ExecStart=.*/bin/swayidle ${expectedArgs}'
|
||||
assertFileRegex $serviceFile 'Environment=.*PATH=${
|
||||
lib.makeBinPath [ pkgs.bash ]
|
||||
}'
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue