1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-10 21:29:48 +01:00

swayidle: always restart systemd unit on failure

Occasionally, swayidle crashes with a failure to connect to the
Wayland session. Ideally, swayidle should automatically restart
instead of leaving the system in a vulnerable state.
This commit is contained in:
9p4 2023-11-11 19:13:38 -05:00 committed by Mikilio
parent eea560a14a
commit dfb56a4a77
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F
2 changed files with 2 additions and 0 deletions

View file

@ -122,6 +122,7 @@ in {
Service = {
Type = "simple";
Restart = "always";
# swayidle executes commands using "sh -c", so the PATH needs to contain a shell.
Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ];
ExecStart =

View file

@ -46,6 +46,7 @@
assertFileExists $serviceFile
assertFileRegex $serviceFile 'ExecStart=.*/bin/swayidle ${expectedArgs}'
assertFileRegex $serviceFile 'Restart=always'
assertFileRegex $serviceFile 'Environment=.*PATH=${
lib.makeBinPath [ pkgs.bash ]
}'