Re:Stack and Nix = portable reproducible builds
by cwp on Thursday December 10, 2015 @03:53PM
(#10713370)
Yeah, I've done something like this as well. It's wrapper around nixpkgs that provides:
* baseline nixpkgs at a specific version
* customized overrides of specific packages
* a library of functions to aid packaging our own software
It works great. It's actually not very much code, but it took a while to figure out what we wanted.
Nixpkgs solves this itself by "owning" the entire dependency tree. That is, if there's a definition in nixpkgs that requires libxml, you can bet it works with the libxml derivation defined in that same nixpkgs. If not, there might be libxml1, libxml2 derivations defined.
In practice, using the ~latest version of everything, or whatever nixpkgs happens to have, usually works well. I started moving toward building my own nixpkgs distribution, which included a vendored copy of nixpkgs at a specific version (rather than whatever version was available at the time you downloaded it), combined with a few customizations for specific (older) versions of, say, libxml. This ensured multiple developers could download things months apart and still expect everything to work. (nixpkgs changes somewhat rapidly.)