So things have changed rather a lot since I last wrote about my, Linux journey? I guess. Looking back, I had been using openSUSE, but in the meantime migrated over to Arch Linux yet have recently landed on NixOS which feels oddly right. It is strange though, I was fairly happy with my Arch setup and was not really seeing myself switching, when I stumbled upon a blog post describing a non-persistent NixOS setup. Essentially, the idea is, since NixOS can boot from only the /nix directory, make the rest non-persistent in some way1, and then create some sort of system with either mounts or symlinks to store only the things you actually care about between boots. Before this, I hadn’t really seen the appeal of Nix; sure the whole language is pretty nice and there is a certain elegance in descriptively building your system, but it just felt like I would end up doing different sorts of “hacks” to get some things working and forget about them thus rendering the Nix code incomplete. This approach forces me to be explicit about everything I do2 which means it’s actually oddly satisfying to use since I know I’m not accumulating cruft over time.
My setup
I’m using impermanence to manage the linking with three partitions in total: one for /boot, one for /nix and finally one for /nix/persist where impermanence links anything I actually want persisted. As mentioned above, / is mounted on a tmpfs, meaning it’s store in RAM3 and as such gets erased when the computer is powered off. On my desktop I am “cheating” a bit since I do have a separate SSD for games that is then mounted separately for my Steam library and Bottles… bottles, but everything else including flatpaks is managed through my Nix configuration.
It’s oddly freeing not to really have to think about trying out some software since I know it won’t really persistently mess up anything, and with how many things are available through nixpkgs it’s been really convenient to just try things out as necessary4 and keep the base system clean. It really does give that fresh install feel constantly, which is awesome.
Drawbacks
At the same time, it does mean that anything not available through nixpkgs is a bit more effort to try out since NixOS doesn’t follow the FHS and as such some prebuilt binaries that work fine in other distros don’t realy work without effort; this is especially a problem with proprietary software, since I can’t just build the binaries myself. Luckily this isn’t a huge use-case for me outside of gaming for which I have Steam and Bottles, so I’ve mostly been able to avoid this problem, but it is still something that has come up.
The other minor annoyance is the need to rebuild the system to apply configuration changes, which can be especially annoying when I am in the middle of customizing something. Now, yes, I can just use mkOutOfStoreSymlink to use dotfiles in a normal manner (which means it once again becomes easier for me to configure things in an ad-hoc manner), or use things like --config launch arguments to start the software with a different configuration file or directory, but both of those are extra things I need to take into account while making changes. All in all, not a huge issue, but still something to be aware of.
Conclusion
For now, I’m quite happy with this setup, and I don’t really see myself changing it anytime in the near future. It feels like a good compromise of stability (with the previous “generations” being available at boot) and customizability with pretty cutting-edge features and packages. I do, at times, miss the good old paru -Syu to just get everything up-to-date, but I think I’ve arrived at a good place for me.
-
The blog post uses ZFS, which I’m personally not a huge fan of on the desktop since it feels like a bit of a resource hog and as such ended up using tmpfs for simplicity ↩︎
-
Well, most things, I can certainly still work around it by persisting some state, but that’s a choice not the default state ↩︎
-
Or swap, depending on the amount of free RAM ↩︎
-
Or even just install them as necessary with
nix shell↩︎