Emulating NixOS' impermanence module on Fedora Atomic
from jamesbunagna@discuss.online to linux@lemmy.ml on 19 Dec 20:50
https://discuss.online/post/14450900

Hey folks! After using Fedora Atomic for quite a while and really appreciating its approach, I’ve been eyeing one particular feature from NixOS: its congruent system management. Inspired from Graham Christensen’s “Erase your darlings” post, I’d like to explore implementing something similar to NixOS’ impermanence module on Fedora Atomic as one step towards better state management.

Why not just switch to NixOS? Well, while NixOS’s package management and declarative approach are incredible, I specifically value Fedora’s stringent package vetting and security practices. The nixpkgs repository, despite its impressive scope, operates more like a user repository in terms of security standards.

I’ve already made some progress with the following:

My current (most likely naive and perhaps even wrong) approach involves tmpfs mounts and bind mounts to /persist, along with systemd-tmpfiles. I’m well aware this won’t give me the declarative goodness of NixOS, nor will it make the system truly stateless - there’s surely plenty of state I’m missing - but I’m hoping it might be another step in the right direction.

Particularly interested in:

Thanks in advance!

#linux

threaded - newest

lily33@lemm.ee on 19 Dec 22:05 next collapse

I’m confused, isn’t Fedora atomic immutable? Shouldn’t that make it stateless automatically?

jamesbunagna@discuss.online on 19 Dec 22:39 collapse

You would have been right if the entire filesystem were to be immutable. However, for Fedora Atomic, /var and /etc are writable. Thankfully so, as most people wouldn’t want a totally locked down operating system. Heck, no general-purpose distro (or OS otherwise) tries to achieve that level of immutability by default.

PotatoesFall@discuss.tchncs.de on 20 Dec 08:19 next collapse

I’m a big fan of fedora atomic and derivatives, but haven’t played around with nix or nixos yet. What’s your goal with the impermanence module?

jamesbunagna@discuss.online on 20 Dec 11:59 collapse

So, the basic premise of the impermanence module is to flush all state on (re)boot. By default, NixOS is already capable of rebuilding your entire system from the config file(s). The impermanence module simply aids in achieving the desired system workflow for no state without reinventing the wheel. In effect, It’s as if you’ve just done a reinstall and setup everything as you like. But you get to experience this on every reboot. For someone that’s perpetually disturbed by state, which has been the case since my Windows-days*, this would finally grant me a peace of mind that I’ve been yearning for years. So, to answer your question, it would help me get (at least one step) closer to stateless Fedora Atomic without giving up general usability.

QuazarOmega@lemy.lol on 20 Dec 08:51 collapse

Sorry, can’t help you there since I’ve found out about that impermanence thing with this post, but I have a question, what is the problem that doesn’t allow you to use Home Manager on Fedora Atomic? AFAIK you just run DeterminateSystems’s Nix installer and everything is set up correctly, aside from maybe a couple of configurations, then you install Home Manager as usual, as the official documentation says

jamesbunagna@discuss.online on 20 Dec 12:13 collapse

Honestly, you could be absolutely right. I haven’t revisited Nix since Bazzite Buzz #12 informed us on the following:

“The Nix ujust script has also been removed due to conflicts with SELinux policies. Users can still install the Nix package manager manually if they so desire at their own risk.”

However, the above could be outdated; I simply don’t know. Are you aware of any developments that have changed things for the better?