[Nix-dev] Generating nixos-compatible binaries? And bootstrapped packages.

Roland Koebler rk-list at simple-is-better.org
Thu Aug 25 22:12:41 CEST 2016


Hi,

> - ...Is there a way binaries can be built on non-nixos linux so that they
> WILL work out-of-the-box on nixos?
maybe the following articles help:
http://anderspapitto.com/posts/2015-02-28-deb-installation-nixos.html
https://sandervanderburg.blogspot.de/2015/10/deploying-prebuilt-binary-software-with.html

Remember that you can install Nix on many Linux distributions, and don't
need to run NixOS to have Nix (see https://nixos.org/nix/). I'm running
Nix on Debian here.

> Extra side question: AIUI, Binaries built on nixos do generally work
> out-of-the-box on OTHER nixos installations, right?
No:
If you *only* copy a binary from one NixOS to another, it only works, if
the 2nd NixOS coincidentally has installed all dependencies of the binary.
And it may break by the next update.

If you copy the closure of the package (=the package itself + all
dependencies; this will probably be a bunch of /nix/store/*-paths),
it works. See: man nix-copy-closure

> (assuming compatible versions of glibc)
No, nothing is assumed here -- that's one of the point of Nix: Nix
explicitely declares the dependencies, and does not guess.


Roland



More information about the nix-dev mailing list