diff options
author | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2023-09-13 21:03:37 +0200 |
---|---|---|
committer | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2023-09-13 21:03:37 +0200 |
commit | 9e5aa81a22bf7a9a3fe3f0de0feb1dde3101b721 (patch) | |
tree | 072b250b8607bd11b62b815a54019dc7497dc644 /nixos/lib | |
parent | 0af23b2c3b081a9970c3cc6ec9a04243ba07988c (diff) |
systemd-lib: add name to X-{Reloads,Restart}-Triggers to easily identify to which service/unit/... they belong
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/systemd-lib.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/lib/systemd-lib.nix b/nixos/lib/systemd-lib.nix index 641b47def0397..f6535b5140659 100644 --- a/nixos/lib/systemd-lib.nix +++ b/nixos/lib/systemd-lib.nix @@ -274,7 +274,7 @@ in rec { }); in "${out}/bin/${scriptName}"; - unitConfig = { config, options, ... }: { + unitConfig = { config, name, options, ... }: { config = { unitConfig = optionalAttrs (config.requires != []) @@ -294,9 +294,9 @@ in rec { // optionalAttrs (config.requisite != []) { Requisite = toString config.requisite; } // optionalAttrs (config ? restartTriggers && config.restartTriggers != []) - { X-Restart-Triggers = "${pkgs.writeText "X-Restart-Triggers" (toString config.restartTriggers)}"; } + { X-Restart-Triggers = "${pkgs.writeText "X-Restart-Triggers-${name}" (toString config.restartTriggers)}"; } // optionalAttrs (config ? reloadTriggers && config.reloadTriggers != []) - { X-Reload-Triggers = "${pkgs.writeText "X-Reload-Triggers" (toString config.reloadTriggers)}"; } + { X-Reload-Triggers = "${pkgs.writeText "X-Reload-Triggers-${name}" (toString config.reloadTriggers)}"; } // optionalAttrs (config.description != "") { Description = config.description; } // optionalAttrs (config.documentation != []) { |