summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorJanne Heß <janne@hess.ooo>2022-01-29 23:01:24 +0100
committerJanne Heß <janne@hess.ooo>2022-02-09 15:14:37 +0100
commitb5b3ee4f7884bf70c04f325e043fe76843b5eacd (patch)
tree5de93ebd959202b52d8ccdee819ce964892964e8 /nixos/modules/system
parentb9bb1de34121312c4c37829b8ee10c81ffd2187a (diff)
downloadnixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.tar
nixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.tar.gz
nixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.tar.bz2
nixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.tar.lz
nixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.tar.xz
nixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.tar.zst
nixpkgs-b5b3ee4f7884bf70c04f325e043fe76843b5eacd.zip
nixos/systemd: Add reloadTriggers to services
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/systemd.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 9dcf9eb769f..1f2dd618698 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -243,6 +243,8 @@ let
           { Requisite = toString config.requisite; }
         // optionalAttrs (config.restartTriggers != [])
           { X-Restart-Triggers = toString config.restartTriggers; }
+        // optionalAttrs (config.reloadTriggers != [])
+          { X-Reload-Triggers = toString config.reloadTriggers; }
         // optionalAttrs (config.description != "") {
           Description = config.description; }
         // optionalAttrs (config.documentation != []) {
@@ -917,6 +919,9 @@ in
               (optional hasDeprecated
                 "Service '${name}.service' uses the attribute 'StartLimitInterval' in the Service section, which is deprecated. See https://github.com/NixOS/nixpkgs/issues/45786."
               )
+              (optional (service.reloadIfChanged && service.reloadTriggers != [])
+                "Service '${name}.service' has both 'reloadIfChanged' and 'reloadTriggers' set. This is probably not what you want, because 'reloadTriggers' behave the same whay as 'restartTriggers' if 'reloadIfChanged' is set."
+              )
             ]
         )
         cfg.services