3 ms·
Your system state in nixos is described in a config file. When you reinstall you won't need to remember what packages you installed, what files you touched in /
by stardenburden 5y ago
Your system state in nixos is described in a config file. When you reinstall you won't need to remember what packages you installed, what files you touched in /etc and worse of all: how you configured your text editor.
All of that state can be described with nix. So if I wanted to reinstall right now, I'd have the exact same system as before.
Naturally you'll have to put in some work to make your system 100% nix, but it's worth it.
That's also why I think it's perfect for projects like this one, people will merely have to copy your config file, change nothing if deploying on the same hardware (except maybe some IP address here and there) and it should all just work:tm:
- djhworld 5y ago> Your system state in nixos is described in a config file. When you reinstall you won't need to remember what packages you installed, what files you touched in /etc and worse of all: how you configured your text editor. I don't see how this is different to ansible, you install an OS then run an ansible playbook remotely via SSH to get your Pi/whatever to the state you want. I have an ansible setup that manages 3 Pis this way, all from one command. Granted, writing YAML is not fun, but i'd like to see a stronger argument why Nix is worth the effort.
- e3bc54b2 5y agoI am not well versed with Ansible, but I understand it to be imperative while Nix is declarative. Put another way, if you add a package to your playbook and then remove it, the package is still there on your system until you remove it old fashioned way. With Nix, if something removed from config, it also automatically gets removed from system. Next and imo biggest benefit of NixOS is generations. Every time you change or update your system, the whole system gets rebuilt and creates a new generation. If kernel update broke your display, you can reboot and select previous entry from boot menu and go about as if update never happened. I'm not aware if Ansible can do that yet. Last, Nix can let you create isolated islands of package config, where you can have your project dependencies setup without affecting or being affected by system dependencies. Obvious examples are Python and Ruby, but these islands or 'nix shell's as they are called can be used to prepare any combination of languages unlike single language tools like pip or cargo. I recommend giving Nix a go for any system for few months. Its not the most pleasant learning experience (documentation is crap, to put nicely), but if you manage to climb that hill, the view will probably make you stay.