5 ms·
I tried using Nix and NixOS early in the year, but documentation is an issue. Also, while I appreciate NixOS’s focus on reproducible configuration, I also have
by jonstewart 5y ago
I tried using Nix and NixOS early in the year, but documentation is an issue. Also, while I appreciate NixOS’s focus on reproducible configuration, I also have 25 years worth of mediocre Unix sysadmin experience, and it would be nice if the system found a way to accommodate Unix. My last straw was trying to get nix to schedule some task through systemd, when what I wanted was a simple crontab.
- Gigachad 5y agoKind of a tangent, but from what I have seen, crontab doesn't actually exist on modern distros, I believe they have a tool that converts the crontab config in to systemd timers. As well as fstab.
- jonstewart 5y agoYes, so I was doubly frustrated in this instance. I know the BSD-style init script system that I learned with Slackware is not geared well towards modern hardware (i.e., laptops), but it was so much simpler to read and comprehend.
- Gigachad 5y agoSystemd timers do have several advantages but they come with more complexity which is why a translation layer is usually applied on user focused distros. You can enable/disable timers, trigger them manually, see when they last triggered, see when they will next trigger. And probably a bunch of other stuff. They also have individual files so automation can easily add or remove timers. For a power user, systemd timers are much better. But if you just want to quickly add one thing, it probably isn’t worth the effort to learn
- nightfly 5y agoCron still exists on Ubuntu at least.
- l0b0 5y agoAfter having configured a bunch of crontabs, I found the Nix+systemd timers approach a massive improvement.
- pxc 5y agoNixOS includes a cron daemon (Vixie cron), and you can add crontab entries directly either as strings or as files: https://search.nixos.org/options?channel=21.05&show=services.cron.enable&from=0&size=50&sort=relevance&type=options&query=services.cron https://search.nixos.org/options?channel=21.05&show=services... You can use, e.g., services.cron.enable = true; services.cron.systemCronJobs = [ '' */30 * * * * someuser bash /path/to/some/script/idk.sh '' ]; or if you really don't want to worry about the Nix syntax for a list of strings, and possible escaping issues, you can just create a crontab file in /etc/nixos next to configuration.nix and write services.cron.cronFiles = [ ./crontab ];