[Nix-dev] deploying nix-built software to non-nix linux systems

Juho Östman sommite+nixdev at kapsi.fi
Mon Nov 10 13:50:38 CET 2014



04.11.2014, 11:38, Eelco Dolstra wrote:
> Hi,
>
> On 04/11/14 10:37, Michael Raskin wrote:
>
>>> No, this is not possible unless you do static linking or some deep
>>> ld-linux/patchelf magic. For instance, my-app will have references to Glibc in
>>> the Nix store, which are not relocatable.
>>
>> Technically, one could install a second Nix instance with
>> /home/target-user/nix instead of /nix as Nix root.
>
> This is not a solution because the resulting binaries are still not relocatable.
>
I have considered that Nix could support relocatable binaries or other 
outputs as an option. If relocatableOutputs attribute were set in a 
derivation, Nix could treat the output as relocatable and, for example, 
use binary substitutes built for another store directory.
In case relocation requires patching, the output directory can contain a 
"relocation table" (analogous to the table in a relocatable ELF binary) 
which can be a script or a data file that can be used to do the patching.
Derivations could support relocation when it is reasonable to do so.

Do you think this would be a bad idea?

Best regards,
Juho Östman


More information about the nix-dev mailing list