Systemd services now have a startAt attribute. If set, NixOS will
automatically emit a timer unit that causes the service to start at
the specified time. For example:
systemd.services.foo =
{ script = "... bla bla ...";
startAt = "02:15";
};
causes the given script to be started at 02:15 every day.
Running it from systemd rather than cron has several advantages:
systemd ensures that only one instance runs at a time; the GC can be
manually started/stopped; and logging goes to the journal.
We still need cron to start the service at the right time, but
hopefully soon we can get rid of cron entirely (once systemd supports
starting a unit at a specific time).