summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/systemd.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2022-01-02 22:54:07 +0100
committerlassulus <lassulus@lassul.us>2022-01-02 22:54:07 +0100
commitbb4fdd13a4d7b975e89118cd264a7f3c60641c62 (patch)
tree921ea90c00cbdb06263ae1f4a6db0f3fcd1d1a15 /krebs/3modules/systemd.nix
parent4b977044b9ec271888da9f97fa91b304fa49abe5 (diff)
parentbf319b980469497a75b8a74d0070d0ee1f6b2c09 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'krebs/3modules/systemd.nix')
-rw-r--r--krebs/3modules/systemd.nix22
1 files changed, 11 insertions, 11 deletions
diff --git a/krebs/3modules/systemd.nix b/krebs/3modules/systemd.nix
index 294f80a3c..194e8b24a 100644
--- a/krebs/3modules/systemd.nix
+++ b/krebs/3modules/systemd.nix
@@ -5,18 +5,18 @@
default = {};
type = lib.types.attrsOf (lib.types.submodule {
options = {
- ifCredentialsChange = lib.mkOption {
- default = "restart";
+ restartIfCredentialsChange = lib.mkOption {
+ # Enabling this by default only makes sense here as the user already
+ # bothered to write down krebs.systemd.services.* = {}. If this
+ # functionality gets upstreamed to systemd.services, restarting
+ # should be disabled by default.
+ default = true;
description = ''
- Whether to reload or restart the service whenever any its
- credentials change. Only credentials with an absolute path in
- LoadCredential= are supported.
+ Whether to restart the service whenever any of its credentials
+ change. Only credentials with an absolute path in LoadCredential=
+ are supported.
'';
- type = lib.types.enum [
- "reload"
- "restart"
- null
- ];
+ type = lib.types.bool;
};
};
});
@@ -40,7 +40,7 @@
lib.nameValuePair "trigger-${lib.systemd.encodeName serviceName}" {
serviceConfig = {
Type = "oneshot";
- ExecStart = "${pkgs.systemd}/bin/systemctl ${cfg.ifCredentialsChange} ${lib.shell.escape serviceName}";
+ ExecStart = "${pkgs.systemd}/bin/systemctl restart ${lib.shell.escape serviceName}";
};
}
) config.krebs.systemd.services;