mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08: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:
committed by
GitHub
parent
67cd4814a2
commit
bd58a1132e
@@ -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
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user