From b48e41b8d75f8a450ed5333a222f85172bbbfc21 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Mon, 15 Dec 2014 14:50:12 +0100 Subject: cron: make into systemd.service and make it depend on /etc/localtime so that changes in timezone will trigger a restart of cron service. --- nixos/modules/services/scheduling/cron.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/scheduling/cron.nix b/nixos/modules/services/scheduling/cron.nix index ded3010ec5ae..1f42086dc1ec 100644 --- a/nixos/modules/services/scheduling/cron.nix +++ b/nixos/modules/services/scheduling/cron.nix @@ -97,12 +97,10 @@ in environment.systemPackages = [ cronNixosPkg ]; - jobs.cron = + systemd.services.cron = { description = "Cron Daemon"; - startOn = "startup"; - - path = [ cronNixosPkg ]; + wantedBy = [ "multi-user.target" ]; preStart = '' @@ -119,7 +117,8 @@ in fi ''; - exec = "cron -n"; + restartTriggers = [ config.environment.etc.localtime.source ]; + serviceConfig.ExecStart = "${cronNixosPkg}/bin/cron -n"; }; }; -- cgit 1.4.1