diff --git a/modules/services/swayidle.nix b/modules/services/swayidle.nix index 6e8b55cb8..7d1fa455b 100644 --- a/modules/services/swayidle.nix +++ b/modules/services/swayidle.nix @@ -121,6 +121,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 = diff --git a/tests/modules/services/swayidle/basic-configuration.nix b/tests/modules/services/swayidle/basic-configuration.nix index caa06ae16..96d983209 100644 --- a/tests/modules/services/swayidle/basic-configuration.nix +++ b/tests/modules/services/swayidle/basic-configuration.nix @@ -46,6 +46,7 @@ assertFileExists $serviceFile assertFileRegex $serviceFile 'ExecStart=.*/bin/swayidle ${expectedArgs}' + assertFileRegex $serviceFile 'Restart=always' assertFileRegex $serviceFile 'Environment=.*PATH=${ lib.makeBinPath [ pkgs.bash ] }'