summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rw-r--r--custom/uucp.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/custom/uucp.nix b/custom/uucp.nix
index a39cf18b..b3026fc1 100644
--- a/custom/uucp.nix
+++ b/custom/uucp.nix
@@ -129,9 +129,9 @@ in {
129 129
130 interval = mkOption { 130 interval = mkOption {
131 type = types.nullOr types.str; 131 type = types.nullOr types.str;
132 default = "00 * * * *"; 132 default = "1h";
133 description = '' 133 description = ''
134 Specification of when to run `uucico' in format used by cron 134 Specification of when to run `uucico' in format used by systemd timers
135 The default is to do so every hour 135 The default is to do so every hour
136 ''; 136 '';
137 }; 137 };
@@ -282,8 +282,15 @@ in {
282 ExecStart = "${config.security.wrapperDir}/uucico -D -S %i"; 282 ExecStart = "${config.security.wrapperDir}/uucico -D -S %i";
283 }; 283 };
284 }; 284 };
285 285
286 services.cron.systemCronJobs = (map (name: "${cfg.interval} ${pkgs.systemd}/bin/systemctl start uucico@${name}.service") (if (cfg.interval != null) then cfg.remoteNodes else [])); 286 systemd.timers = let
287 timer = name: {
288 name = "uucico@${name}";
289 value.timerConfig = {
290 OnUnitInactiveSec = cfg.interval;
291 };
292 }
293 in builtins.listToAttrs (map timer (if (cfg.interval != null) then cfg.remoteNodes else []));
287 294
288 networking.networkmanager.dispatcherScripts = optional cfg.nmDispatch { 295 networking.networkmanager.dispatcherScripts = optional cfg.nmDispatch {
289 type = "basic"; 296 type = "basic";