4 ms·
> Every package you could want is in Nix Is it though? I deploy applications (a mix of Python, node and C++) for which the vast majority of the dependencies ar
by perrygeo 8y ago
> Every package you could want is in Nix
Is it though? I deploy applications (a mix of Python, node and C++) for which the vast majority of the dependencies are missing, misconfigured or out of date in nixpkg. Sure I could volunteer to maintain dozens of nix packages but the fact remains that forcing all of your deps through a single packaging system is risky. NixOS in particular encourages you to buy into the ecosystem 100% or not at all. That's a big ask, even for small organizations.
Compare that to Docker where your can build your app on top of any base image and use/develop/deploy that artifact from many different environments. I can distribute and build my dependencies in whatever way is appropriate for my application, my team and collaborators can hack on that image from their chosen OS, and the application can be built deterministically and deployed anywhere that can run a docker daemon. No lock-in required: the dev host OS, deployed host OS and container OS are managed independently. Docker is not as "pure" as NixOS but it works under the real-world constraints of heterogeneous environments.
Of course everything would be better if we could all agree on one package manager and one OS and one programming language for that matter. But we can't, so the clear winner is the technology that can leverage this homogeneity into a uniform build artifact (containers). Technologies that require package-level homogeneity across an organization in order to succeed are fighting an uphill battle.
- colemickens 8y agoThe claimed advantages of Docker over Nix here don't line up with the reality I've seen after years of experience with Docker and Nix, particularly with how they relate to services that wind up deployed with Kubernetes. I can do almost all the same things that you do with Docker, with Nix. Why would I ever need a different base image if I'm composing my image with Nix? Nix+Docker is the best of both worlds and there's really absolutely no reason to not pair them together. Besides if for some reason, you can't package something in Nix, or refuse to buy into the `nixpkgs` ecosystem, you can still build a reproducible Docker image with whatever base layer you want (`alpine`, `redis`, whatever), with Nix, and benefit from all of the benefits mentioned in this post and others in this thread. Deployment time, yeah, they're all opaque containers and they can be running whoknowswhat. But for day to day development, Nix absolutely beats Docker. I've spent way too much of my life rebuilding binaries and container images that already exist. Wasted too much of my life on containers and binaries of unknown, unreproducible origins. None of those things are concerns when you're building your container images with Nix. They're not even a thought I have any more.