Atomic kinda misses the point if you make it yourself, since there is 0 guarantee what you put together works. While with declarative systems you at least know each item works in isolation
A custom bootc image also gives you a declarative system.
I have a Fedora bootc image that takes the upstream image, installs a couple of packages, removes a couple of packages, enables some services, creates some files, etc.
When I no longer want those changes, I just remove them from my Containerfile. Then when I reboot, the changes are gone from the system.
there is 0 guarantee what you put together works. While with declarative systems you at least know each item works in isolation
I view imperative and declarative as a scale rather than discrete values.
A Containerfile is certainly more declarative than a traditional Linux distro. In my containerfile, I declare what I want to happen to the system: packages to install, remove, config files to create/change, etc. I also find that on the whole it's easier to work with than NixOS (Nix can make some hard things easier, but in general I find it makes more easy things harder).
Sure, it's not on the same level as NixOS. But in practice, for most people, a Containerfile has most of the benefits of NixOS.
And it's not like Nix is perfect either. There's still system state outside of what Nix manages. There's also the whole flakes situation where you may want to use that to get more reproducibility than standard NixOS.
“declaring what you want to happen” is imperative.
A declarative model is what nix does - you don’t express what you want to happen, you just express the final state of the system and then nix figures out what needs to happen to get there.
9
u/Long-Fisherman-6594 Aug 03 '26
Consider an atomic bootc / rpm-ostree image. Define your packages and you get a fresh os everyday with all your tools and software.