diff --git a/modules/services/hypridle.nix b/modules/services/hypridle.nix index 0e28c5438..0d8a337b4 100644 --- a/modules/services/hypridle.nix +++ b/modules/services/hypridle.nix @@ -81,7 +81,7 @@ in { Description = "hypridle"; After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; - X-Restart-Triggers = + X-Restart-Triggers = mkIf (cfg.settings != { }) [ "${config.xdg.configFile."hypr/hypridle.conf".source}" ]; }; diff --git a/tests/modules/services/hypridle/default.nix b/tests/modules/services/hypridle/default.nix index c959983c0..b351f1c00 100644 --- a/tests/modules/services/hypridle/default.nix +++ b/tests/modules/services/hypridle/default.nix @@ -1 +1,4 @@ -{ hypridle-basic-configuration = ./basic-configuration.nix; } +{ + hypridle-basic-configuration = ./basic-configuration.nix; + hypridle-no-configuration = ./no-configuration.nix; +} diff --git a/tests/modules/services/hypridle/no-configuration.nix b/tests/modules/services/hypridle/no-configuration.nix new file mode 100644 index 000000000..805e49561 --- /dev/null +++ b/tests/modules/services/hypridle/no-configuration.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: + +{ + services.hypridle.enable = true; + + test.stubs.hypridle = { }; + + nmt.script = '' + config=home-files/.config/hypr/hypridle.conf + clientServiceFile=home-files/.config/systemd/user/hypridle.service + assertPathNotExists $config + assertFileExists $clientServiceFile + ''; +}