mirror of
https://github.com/nix-community/home-manager
synced 2024-12-28 04:39:48 +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:
parent
67cd4814a2
commit
bd58a1132e
3 changed files with 22 additions and 2 deletions
|
@ -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}" ];
|
||||
};
|
||||
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
{ hyprpaper-basic-configuration = ./basic-configuration.nix; }
|
||||
{
|
||||
hyprpaper-basic-configuration = ./basic-configuration.nix;
|
||||
hyprpaper-no-configuration = ./no-configuration.nix;
|
||||
}
|
||||
|
|
17
tests/modules/services/hyprpaper/no-configuration.nix
Normal file
17
tests/modules/services/hyprpaper/no-configuration.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue