- declarative configurations are the biggest deal
Functional purity etc. was high on the list (I am a FPer). Declarativeness also beats reproducibility (both are tied together, cannot do one well without the other) - even though it’s only number two on the list on NixOS.org (it should be number one!!)
I think this reflects where Nix has grown the most. (e.g. from the 2022 Nix Survey Results, 80% of the respondents use NixOS).
Rather, for two families of use cases:
(1) manage how a team’s software is moved about.
(2) manage the software/setup on my computer.
The norm for (2) is just using a package manager to install packages & its dependencies; and ‘beating’ a system into shape by directly editing the configuration files which get read. – Some non-Nix solutions people use include “having a notes file to keep track of what I should install on a fresh setup”, or maybe using filesystem snapshots or just re-installing the entire OS if something goes wrong.
The norm for (1) these days tends to be Docker containers, and prob’ly Kubernetes to orchestrate that.
The ‘risk’ of using Nix is that you might not know how to get what you want done with Nix. In (1), it’s a whole team that has to pay that risk, whereas with (2) it’s just you. (That nix can be difficult somewhat restricts it to enthusiasts atm; which is not really an issue for (2)).
In terms of benefits Nix can offer each; for (1), copying images may not be elegant, but it works; for (2), yeah I think this is where the “declarative” / “as code” is compelling compared to what others do. – I think this is why I see much more excitement about Nix flakes, than about tools (say) NixOps or the nixos image generators.
My favourite ‘elevator pitch’ of Nix is “it’s like Docker, without Docker containers”. (nix run
is like docker run
, but you don’t have to fuss with volume mounts…). Next would be thinking of NixOS as “like terraform, but for the Operating System’s configuration”.
Reproducibility is foundational, though; even if it’s not as sexy. – I do remember it was always a pain to go back and touch some side project after months/years, since the first step would somehow often be a chore to update the project following updates to the system’s package repository. I like relying on Nix to avoid having to do that.