3 ms·
side question: Why do I use NixOS instead of Ubuntu + ansible combo ?
by m00dy 2y ago
side question:
Why do I use NixOS instead of Ubuntu + ansible combo ?
- TheDong 2y agoIf you have an ansible playbook that runs "apt-get install docker" you'll get a different version over time, even with no changes to your playbook. 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.
- yjftsjthsd-h 2y ago> With nix, every package version change, every single diff, is a git commit which you can roll back and track a breakage to. 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.
- TheDong 2y agoIf you're not using something like npins or nix flakes then you're not really using nix correctly, and have abandoned the light of god.
- yjftsjthsd-h 2y agoTo oversimplify and only pick one aspect: 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.
- otabdeveloper4 2y agoNixOS is infrastructure-as-code, for real this time. (The downside is that now you have to write code.)
- 1attice 2y agoDifficult to summarize, but the short answer is: immutability, reproducibility, and reversibility (i.e. you can revert/de-revert almost any change instantly). 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.