cron: make into systemd.service and make it depend on /etc/localtime

so that changes in timezone will trigger a restart of cron service.
This commit is contained in:
Rob Vermaas 2014-12-15 14:50:12 +01:00
parent 5819f29875
commit b48e41b8d7

View File

@ -97,12 +97,10 @@ in
environment.systemPackages = [ cronNixosPkg ]; environment.systemPackages = [ cronNixosPkg ];
jobs.cron = systemd.services.cron =
{ description = "Cron Daemon"; { description = "Cron Daemon";
startOn = "startup"; wantedBy = [ "multi-user.target" ];
path = [ cronNixosPkg ];
preStart = preStart =
'' ''
@ -119,7 +117,8 @@ in
fi fi
''; '';
exec = "cron -n"; restartTriggers = [ config.environment.etc.localtime.source ];
serviceConfig.ExecStart = "${cronNixosPkg}/bin/cron -n";
}; };
}; };