diff --git a/modules/services/hyprpaper.nix b/modules/services/hyprpaper.nix index ede09b258..6c9ddb2cf 100644 --- a/modules/services/hyprpaper.nix +++ b/modules/services/hyprpaper.nix @@ -75,7 +75,7 @@ in { Description = "hyprpaper"; After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; - X-Restart-Triggers = + X-Restart-Triggers = mkIf (cfg.settings != { }) [ "${config.xdg.configFile."hypr/hyprpaper.conf".source}" ]; }; diff --git a/tests/modules/services/hyprpaper/default.nix b/tests/modules/services/hyprpaper/default.nix index 2a5abbfed..d3e87df43 100644 --- a/tests/modules/services/hyprpaper/default.nix +++ b/tests/modules/services/hyprpaper/default.nix @@ -1 +1,4 @@ -{ hyprpaper-basic-configuration = ./basic-configuration.nix; } +{ + hyprpaper-basic-configuration = ./basic-configuration.nix; + hyprpaper-no-configuration = ./no-configuration.nix; +} diff --git a/tests/modules/services/hyprpaper/no-configuration.nix b/tests/modules/services/hyprpaper/no-configuration.nix new file mode 100644 index 000000000..15775e886 --- /dev/null +++ b/tests/modules/services/hyprpaper/no-configuration.nix @@ -0,0 +1,17 @@ +{ pkgs, ... }: + +{ + services.hyprpaper = { + enable = true; + settings = { }; + }; + + test.stubs.hyprpaper = { }; + + nmt.script = '' + config=home-files/.config/hypr/hyprpaper.conf + clientServiceFile=home-files/.config/systemd/user/hyprpaper.service + assertPathNotExists $config + assertFileExists $clientServiceFile + ''; +}