by nextos · 2y ago · 0 comments
Despite the myth, it is not hard to use unless you need to package something complicated or messy. Then it may become hard.
The advantage of Nix is total version reproducibility and declarativeness. It's quite reassuring to know things are exactly the same on all computers.
The problem is that everything works--until it doesn't. And then nobody knows how to fix it.
You wind up needing a single person who serves as local "nix tech support" who then hates life because he's a high end devloper dealing with nix n00bs all day long.
Programming language-specific dependency tools succeeded due to their user friendliness, however abysmal they are in multi-language / OS dependent environments (and I despise them for that reason). Cargo.toml, go.mod, conan.txt, Dockerfile etc. all are can be understood by basically all members of a dev team. You cannot say the same for Nix for most devs in a team.
We still use language-specific tools for those dependencies, though, since that is what people are familiar with. I think this strikes a fine balance: nix describes the “operating system” that we all work in, and then Cargo, npm, etc lockfiles describe each language’s dependencies.
I wish though, that at my job people were as far as using Nix oder Guix though. Still a long way off of that. Wish people would explore more on and off the job, to realize the potential.
Most of package managers don't offer that guarantee. Only Guix has a similar level of assurance?
Nix openly recognizes outputs are different per platform, x86_64-linux is different from aarch64-darwin. Impossible not to, as ultimately architectures may behave differently.
I feel somewhat blessed that I get to work on tools at a company that can support a dedicated tools team. We are free to use the best tool for the job without needing to worry about popularity contests, and nix has truly been a game changer for us.
Frankly, the biggest problem is that it needs some better docs, i.e. some serious corporate funding to get them written.
As it happens, /etc/nix/nix.conf is one file where such a potential conflict can occur. As an optimization, I think it will (sometimes? always? idr) replace a file if the existing one and its intended replacement have the same contents. The defaults /etc/nix/nix.conf in the mainline Nix installer and the defaults for /etc/nix/nix.conf in Nix-Darwin are the same, so it doesn't complain there. But the Determinate Nix Installer ships a nix.conf with different settings, so Nix-Darwin refuses to replace it, to avoid clobbering your (the Determinate Nix Installer's) settings 'changes'.
There's no real compatibility issue, and the Determinate Nix Installer is doubtless intended to be used with any Nix-based software, including Nix-Darwin, Home Manager, etc. Nix-Darwin installation is just a bit hairy, as it's unfortunately always been.
NixOS is a better experience in that respect, and you should consider running NixOS in a VM if you want to get a feel for that kind of systemwide, declarative Nix configuration without worrying about installing it against a foreign base system. (If you do learn your way around nixos-rebuild, you won't need the Nix-Darwin installer anyway.)
But seriously, let's say you have a Python project (like a Django application with a couple requirements in your `requirements.txt`), what is the least disruptive way to get it working? Many things I've looked at involved doing one-time transformations of requirements files or otherwise easy-to-desync things...