[Nix-dev] Using nix to produce distributable binaries?

Tom Ridge tom.j.ridge at googlemail.com
Thu Aug 20 16:18:28 CEST 2015


Dear nix-dev,

(I am a novice nix user, so please go easy on me!)

I have a repository which uses nix to build (
https://github.com/sibylfs/sibylfs_src )

The build produces some executables and a shell script.

I would like to just tar up the executables and the script, to distribute
to others (who may not have nix).

However, the shell script #! initial line contains a reference to
eg /nix/store/zmd4jk4db5lgxb8l93mhkvr3x92g2sx2-bash-4.3-p39/bin/bash

(very sensible for my local system; not so sensible when shipping the shell
script to others). I get the error:

bash: /tmp/fs_test.sh:
/nix/store/zmd4jk4db5lgxb8l93mhkvr3x92g2sx2-bash-4.3-p39/bin/bash: bad
interpreter: No such file or directory

when trying to run the shell script on another system (which does not have
nix).

Also, the executables contain two references to the nix store:

/nix/store/q0m70q5wg21hxrixkp1xk4x95sfs2fln-glibc-2.21/lib/ld-linux-x86-64.so.2
/nix/store/q0m70q5wg21hxrixkp1xk4x95sfs2fln-glibc-2.21/lib

When distributing the executables, I guess that these should not be there
(and instead, the other system's ld and glibc should be used).

What is the recommended best practice for releasing binaries using nix? How
can I remove the dependencies on the nix store?

Thanks

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150820/62792a84/attachment.html 


More information about the nix-dev mailing list