by m00dy · 1y ago · 0 comments
Why do I use NixOS instead of Ubuntu + ansible combo ?
If you have this ansible:
- package:
state: present
name:
- foo
- bar
- baz
and remove baz from the list, baz will still be installed. If you have this NixOS config: packages = with pkgs; [
foo
bar
baz
]
and remove baz, you will no longer have baz installed[0]. Or put differently, ansible is never comprehensive, nix is[1]. Of course, ansible is a lot easier IMHO so choose your tradeoffs.[0] I mean, insofar as packages are ever "installed" in nix. But for our purposes using that word is fine.
[1] Generally. Like, nothing prevents you from creating a python virtualenv or dropping config files around or coloring outside the lines in other ways, but using the system in the straightforward idiomatic way does leave you with everything encoded in a single config.
With nix, every package version change, every single diff, is a git commit which you can roll back and track a breakage to.
If you want, you can run your own apt repos, pin all your apt package versions, etc and make ubuntu a little more reproducible, but it's hard to do it. The system fights against you.
yaml also sucks, and nix is a better language.
Use whatever you want.
I think this is only true if you use flakes or jump through some hoops? Otherwise you of course can roll back to a previous generation, but not a previous commit.
It's on another level, as compared to Ubuntu, but it's also much more intrinsically demanding.
And lately it has unfortunately become a culture war battleground.
(The downside is that now you have to write code.)