1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

hyprpaper: fix service when no config file

The systemd user service depends on

  config.xdg.configFile."hypr/hyprpaper.conf".source

for `X-Restart-Triggers`. When `cfg.settings` is the default `{}`,
this causes failure since

  config.xdg.configFile."hypr/hyprpaper.conf".source

will not exist.

Making the addition conditional on `cfg.settings` actually having
content, which would mean `xdg.configFile."hypr/hyprpaper.conf"` does
exist, avoids the error.
This commit is contained in:
Sebastián Zavala Villagómez 2024-11-24 08:05:10 -05:00 committed by GitHub
parent 67cd4814a2
commit bd58a1132e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 2 deletions

View file

@ -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}" ];
};

View file

@ -1 +1,4 @@
{ hyprpaper-basic-configuration = ./basic-configuration.nix; }
{
hyprpaper-basic-configuration = ./basic-configuration.nix;
hyprpaper-no-configuration = ./no-configuration.nix;
}

View file

@ -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
'';
}