git.iko.soy/typeable/nixpkgs
on master help sign in
cron: make into systemd.service and make it depend on /etc/localtime

so that changes in timezone will trigger a restart of cron service.

commitb48e41b8d75f8a450ed5333a222f85172bbbfc21 authorRob Vermaas <rob.vermaas@gmail.com> dateMon 15 Dec 2014, 14:50 (12 years ago) parent5819f29
1 file changed+4−5
nixos/modules/services/scheduling/cron.nix+4−5
nixos/modules/services/scheduling/cron.nix+4−5
@@ -97,12 +97,10 @@ in
9797
9898 environment.systemPackages = [ cronNixosPkg ];
9999
100− jobs.cron =
100+ systemd.services.cron =
101101 { description = "Cron Daemon";
102102
103− startOn = "startup";
104−
105− path = [ cronNixosPkg ];
103+ wantedBy = [ "multi-user.target" ];
106104
107105 preStart =
108106 ''
@@ -119,7 +117,8 @@ in
119117 fi
120118 '';
121119
122− exec = "cron -n";
120+ restartTriggers = [ config.environment.etc.localtime.source ];
121+ serviceConfig.ExecStart = "${cronNixosPkg}/bin/cron -n";
123122 };
124123
125124 };