summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-08-05 23:16:18 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-08-05 23:16:18 +0200
commit8953ba92a76a4b46b9de0dfcc48f7231f7c909da (patch)
treef7cad3c0443ca320c0ac239a6ec007e03a43ebf3 /custom
parent8fef7dcbf473e0da17f20289415d41e2711ce7fd (diff)
downloadnixos-8953ba92a76a4b46b9de0dfcc48f7231f7c909da.tar
nixos-8953ba92a76a4b46b9de0dfcc48f7231f7c909da.tar.gz
nixos-8953ba92a76a4b46b9de0dfcc48f7231f7c909da.tar.bz2
nixos-8953ba92a76a4b46b9de0dfcc48f7231f7c909da.tar.xz
nixos-8953ba92a76a4b46b9de0dfcc48f7231f7c909da.zip
Convert uucp to systemd timers
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";