From 3f6494f5155bae814bb4dd04269335e1cb4b42d6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 12 Apr 2017 19:35:23 +0200 Subject: Uucp calling using systemd --- custom/uucp.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index 239ec476..a39cf18b 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -275,7 +275,15 @@ in { uucp ]; - services.cron.systemCronJobs = (map (name: "${cfg.interval} ${config.security.wrapperDir}/uucico -D -S ${name}") (if (cfg.interval != null) then cfg.remoteNodes else [])); + systemd.services."uucico@" = { + serviceConfig = { + User = "uucp"; + Type = "oneshot"; + ExecStart = "${config.security.wrapperDir}/uucico -D -S %i"; + }; + }; + + services.cron.systemCronJobs = (map (name: "${cfg.interval} ${pkgs.systemd}/bin/systemctl start uucico@${name}.service") (if (cfg.interval != null) then cfg.remoteNodes else [])); networking.networkmanager.dispatcherScripts = optional cfg.nmDispatch { type = "basic"; @@ -286,7 +294,7 @@ in { case "''${2}" in (?(vpn-)up) - ${concatMapStringsSep " \n" (name: "${config.security.wrapperDir}/uucico -D -S ${name}") cfg.remoteNodes} + ${concatMapStringsSep " \n" (name: "${pkgs.systemd}/bin/systemctl start uucico@${name}.service") cfg.remoteNodes} ;; esac ''; -- cgit v1.2.3