Some time ago I was having a dependency-hell problem with a C++ program that used particular library versions which were available in Fedora (dev machine) but not Ubuntu (target) - plus there were no static versions of the library to compile the program as a static binary.
So I used nix to build the package for me. It also did not have the right version of one library, but I was able to "fork" the library for my build alone in the same configuration file. Then I was able to nix-copy-closure my program to a remote host, and it copied all dependencies over (and nothing more) and I was able to run it under Ubuntu.
Nix is great. I think it is the more proper solution to the problem people have been trying to fix with Docker.