Why We’re Moving on From Nix

9 points by uncenter


dkl

I want to be clear, we don’t have any problem with Nix itself. But there is a problem with how we were using it. Trying to abstract all the parts of Nix that make Nix… Nix, just fundamentally doesn’t work.

I don’t want to be critical here but I do feel like they were trying to subvert the paradigm.

A key idea of using Nixpkgs is that the entirety of it should work together. So yes, users cannot mix-and-match versions of dependencies between different versions of Nixpkgs. This is something I also struggle to come to terms with. I think the right way to use Nix for something like Python is to tell Nix your packages, choose a version of Nixpkgs and let it handle the specific versions. You pin to that Nixpkgs. The dependencies are also pinned as a result.

As for the image issues, if you let Nix build a layered image, you’ll basically get a layer for each dependency. This is great because as your application changes, only your application layer gets rebuilt. How big is your source code? It’s probably measured in KB or tens of MB. That’s how big your final image layer will be. The other layers will be for each of your dependencies that Nix calculated, and there will be a lot of them, but they will be cached for as long as you leave things pinned with Nix. This is a great improvement IMO. But you have to let Nix build your images rather than using Docker.

It looks like the product from this company wants to do a mixture of Nix choices and developer-facing choices. I think devenv is probably a better approach to this problem, because in the end Nix is in charge of what happens. Nix is kind of like Kubernetes; you don’t want to put it into a box and build up abstractions around it, you kind of have to make it the outermost layer and if you want abstraction, build it within the box.

That said, it looks like an interesting product, and I clicked the link because even though I am pretty enthusiastic about Nix, it isn’t without its shortcomings and getting things fully moved into it is not trivial, so I remain curious about why and how people abandon it.