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

Nick Sabalausky bus_nixos_list at semitwist.com
Thu Aug 25 22:39:34 CEST 2016


On 08/25/2016 04:12 PM, Roland Koebler wrote:
> 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.
>

Thanks. That first link I'd come across before and had trouble grokking, 
but I'll take a closer look again (at both), especially now that I think 
I have a better understanding of patchelf.

>> 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
>

Ahh, ok I see now. And it sounds like these closures are involved in how 
nix's binary caches are able to work successfully then?



More information about the nix-dev mailing list