[Nix-dev] Packaging Bash Scripts

Alexander Foremny alexanderforemny at gmail.com
Wed Aug 29 11:27:45 CEST 2012


Hello list,

I am currently trying to create a Nix expression for plowshare [1]. I
got a working version [2] already, since installation is quite
straight forward. However, as mentioned in the pull request I am
worrying about purity.

In particular the Bash script calls the curl binary. The first
observation is that running one of plowshare's executables the curl
binary is being found correctly. I think this is because curl is
available in my PATH.

> $ which curl
> ~/.nix-profile/bin/curl

I would have expected that this wouldn't be the case if I had removed
curl from my environment. However, the following still yields the same
result.

> $ nix-env -e curl
> $ which curl
> ~/.nix-profile/bin/curl

This also arises in a newly created shell and I can also execute the
curl binary. I am guessing that curl is some kind of NixOS' standard
environment. Is this correct?

Is it considered an impurity that plowshare finds curl without
depending on curl's derivation? If this is the case, is this impurity
introduced by NixOS or by the Nix expression?

If this is an issue, how would I solve it? Should I patch plowshare's
Bash scripts to refer to the curl's derivation instead of `which
curl`? Or even better, is there a wrapper for this kind of programs
already?

Regards,
Alexander Foremny

[1] http://code.google.com/p/plowshare/
[2] https://github.com/NixOS/nixpkgs/pull/117


More information about the nix-dev mailing list