Comment by Cyph0n
1 month ago
It’s even more pleasant when you use a distro that natively uses systemd and provides light abstractions on top. One such example is NixOS.
1 month ago
It’s even more pleasant when you use a distro that natively uses systemd and provides light abstractions on top. One such example is NixOS.
NixOS is anything but a light abstraction (I say this as a NixOS user).
Tbh it feels like NixOS is convenient in a large part because of systemd and all the other crap you have to wire together for a usable (read compatible) Linux desktop. Better to have a fat programming language, runtime and collection of packages which exposes one declarative interface.
Much of this issue is caused by the integrate-this-grab-bag-of-tools-someone-made approach to system design, which of course also has upsides. Redhat seems to be really helping with amplifying the downsides by providing the money to make a few mediocre tools absurdly big tho.
How is it not a light abstraction? If you're familiar with systemd, you can easily understand what the snippet below is doing even if you know nothing about Nix.
In my view, using Nix to define your systemd services beats copying and symlinking files all over the place :)
The value brought by NixOS is on line 6.
NixOS let you build the abstraction you want, and mix them with abstractions provided by others, and this single line illustrates this point extremely well as `sops` is not yet part of NixOS.
Secret management would likely come in NixOS in the future, but in the mean time you can add either use https://github.com/Mic92/sops-nix or https://github.com/ryantm/agenix to make it possible to manage files which have content that should not be public.
Other package managers also provide some abstraction over the packages, and would likely see the same systemd configuration abstracted the same way in post-install scripts. Yet, the encrypted file for `rclone.conf` would come as a static path in `/etc`.
You could resume NixOS as having moved the post-install script logic before the installation, yet this tiny detail gives you additional abilities to mix the post-install scripts and assert consistency ahead of making changes to the system.
Hah I just wrote something similar today to periodically push backups to another server from my NAS.
I agree the systemd interface is rather simple (just translate nix expression to config file). But NixOS is a behemoth; Completely change the way how every package is built, introduce a functional programming language and filesystem standard to somehow merge everything together, and then declare approximately every package to ever exist in this new language + add a boatloat of extra utilities and infra.
2 replies →