[Nix-dev] ${out}

Marc Weber marco-oweber at gmx.de
Sun Apr 11 15:05:01 CEST 2010


Hi Yury,

You've missed one important thing:

derivation  {
  foo="some text";
}

will make foo an env var to the builder script.
So no evaluation of $out will take place here.

It may happen that the text is reused. Eg using 

othervar=$(eval "$foo") which will make /bin/sh evaluate $out and
replace it by /nix/store.

So the easiest way to replace $out by /nix/store is
defining  configureFlags within a script. Eg

preConfigure = ''
  configureFlags="--with-openssl=${openssl} --with-plugindir=\${out}/lib/sasl2 --with-configdir=${out}/lib/sasl2";
'';

which will make /bin/sh evaluate the $out and replace it by the store path.
The important thing to understand is that *all* env vars are used to
calculate the hash of out. So out can't be available within nix code.
The first application seeing it is the build script or depending
packages.

HTH
Marc Weber



More information about the nix-dev mailing list