mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
hypridle: fix service when no config file
The systemd user service depends on config.xdg.configFile."hypr/hypridle.conf".source for `X-Restart-Triggers`. When `cfg.settings` is the default `{}`, this causes failure since config.xdg.configFile."hypr/hypridle.conf".source will not exist. Making the addition conditional on `cfg.settings` actually having content, which would mean `xdg.configFile."hypr/hypridle.conf"` does exist, avoids the error.
This commit is contained in:
parent
bd58a1132e
commit
5e2f47c5a5
3 changed files with 19 additions and 2 deletions
|
@ -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}" ];
|
||||
};
|
||||
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
{ hypridle-basic-configuration = ./basic-configuration.nix; }
|
||||
{
|
||||
hypridle-basic-configuration = ./basic-configuration.nix;
|
||||
hypridle-no-configuration = ./no-configuration.nix;
|
||||
}
|
||||
|
|
14
tests/modules/services/hypridle/no-configuration.nix
Normal file
14
tests/modules/services/hypridle/no-configuration.nix
Normal file
|
@ -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
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue