Honestly, I find it infinitely easier to just do everything in in docker containers. Then the OS doesn't matter except for installing docker, and running docker-compose up.
Docker is for containing the environment of your apps. NixOS is for configuring your operating system. I use NixOS to define which Docker apps run on my machine, as well as monitoring and administration tools, firewall setup, that sort of thing.
If all you do is apt-get install docker, that doesn't feel like a very complete set up to me.
I'm saying if you run all your apps in containers, there really isn't much left to configure on the OS. Using Ansible for those few things seems like an easier solution.
But Ansible is an incomplete and extra part of software just to make your operating system behave like you want it to. Why not just pick an operating system that behaves like you want it to from the ground up?
Yeah, that argument is weird. If we are taking about state the difference between those two is that docker is just storing a snapshot of a state (BTW Dockerfile by itself is not reproducible and is comparable to a bash script) while Nix is storing information how to get to a given state.
That makes it far more versatile. It is what Docker promised to be, but ended up being an overglorified zip file. Depending on your needs, that might be all you actually want. If you want to make small adjustments to existing state (let say applying a patch, in docker you pretty much have to rebuild from scratch and with non-deterministic Dockerfile you might change more than that), or maybe compose something new from existing components, Nix gives you far greater control to do that.
Yes, the Dockerfile has serious shortcomings and makes it totally miss the mark on what it was promising, but based on some comments about how nix is hard, it probably helped with adaptation.
Seems like it comes much easier to most people to issue series of (often nondeterministic) commands that mutate state rather than learning a new language that allows describing dependencies and have it figure out steps needed.
Yes obviously docker is primitive and people prefered that, just like they prefered php4/wordpress, it was the right match for a nascent space/market.
The issue to me is that it's mostly a regression and that when showed nix/guix people would squint saying it's horrible.. when in fact docker way is horrible, it's just nicer to them.