So if your whole machine’s environment is already specified, why do you need to add Docker as another layer of abstraction? Is it simply to deal with needing to run multiple apps on the same underlying machine (defined by Nix) with possibly conflicting dependencies (those would be managed by Docker)?
Docker on the other hand doesn’t solve this problem itself - docker images can be built declaratively (eg. with nix itself), but it is more about managing the running of services with possibly different environments. A typical dockerfile will not be identical at all between two separate creations (most of the time it just installs programs from a repository without any versioning other than perhaps the distro’s major version)
The fact that we as in software developers use it for dev environment is just the unfortunate way it is.
You're not using Docker in development because of the sync issues on Mac between the host and the containers, but ideally you still want as much as possible the development and production environment parity (same versions of dependencies, etc). You can build your Docker images with Nix to ensure the dependencies versions you're developing with will be the same in prod.