by dangus · 4y ago · 0 comments
Python has pyenv, NodeJS has nvm, Terraform has tfenv, and the list goes on.
Then if you're running on a server/VM/cloud, it seems to me that you should be treating your systems as cattle instead of pets. I never update packages on servers, I build a new image/instance, test it, and replace the server.
I wonder if some of the benefits of NixOS were either solutions looking for problems or solutions where better solutions rose to prominence.
I haven't even started talking about containerization, either!
I have six or so servers, all of them configured differently. Not completely differently; they share some configuration. But not very similarly either.
They're pets. They have a lot of state. Backups are running, but I certainly don't want to reinstall them.
Despite being pets, I still want to do as little work to manage them as I possibly can. NixOS is great in this scenario.
Nix makes these all largely irrelevant, in a consistent way. If anything I would say this supports nix's usage.
> Then if you're running on a server/VM/cloud, it seems to me that you should be treating your systems as cattle instead of pets. I never update packages on servers, I build a new image/instance, test it, and replace the server.
You can do this is nix as well. You can take a configuration.nix and ship it as a version controlled file, an iso image, pxe boot image, ami, vhd, or other formats.
> I wonder if some of the benefits of NixOS were either solutions looking for problems or solutions where better solutions rose to prominence.
I don't think so: https://blog.flyingcircus.io/2016/05/06/thoughts-on-systems-...
> I haven't even started talking about containerization, either!
Containers generally take an impure process and create a "snapshot-in-time". Nix allows you to "hydrate" your configuration in a reproducible and repeatable fashion. OCI images can only really be layered, can't be composed, and commands like `sudo apt-get install` or `pip install` also makes the runtime behavior dependent on when the image was created.