You Don't Love systemd Timers Enough

108 points by edwardloveall


enobayram

Note that the author uses NixOS as hinted at in many places and I think this is one of the main reasons why they like systemd (timers) so much. NixOS makes it very easy to declare what systemd setup you want in a single file with all the flexibility of a programming language and NixOS makes sure the right systemd unit files show up at the right place and get removed when you don't declare them anymore.

You can see an example in the NixOS wiki. Those snippets all go in your system configuration and if you make mistakes you even get validation errors while building (well ahead of deploying). You also don't need to worry about PATH because you'll typically refer to packages inside nixpkgs (or some other source of nix packages), which means they will be spliced in with their absolute path in the nix store and again, you'll get a build time error if you make a mistake.

IMO NixOS completely removes all the major hurdles of setting up any nontrivial machinery with systemd.

diktomat

At this point the systemd haters peer out of the woodwork in anticipation of torpedoing timers because they are part of the systemd project and because they replace mature (if clunky) technology. I'd rather not spend our time arguing about cron, so briefly consider why newer solutions like systemd timers that benefit from years of hindsight are better:

I feel like this is the case with many parts of systemd. It by no means is perfect, but lots of its design decisions are based on learnings from the (more traditional) past. I recently re-listened to CRE’s (a German podcast) 2015 episode with Lennart Poettering, where he explains the reasoning behind some of it, and can still recommend it today.