[Nix-dev] Re: Re: ${out}

Yury G. Kudryashov urkud+nix at ya.ru
Sun Apr 11 17:49:31 CEST 2010


Jeff Johnson wrote:
>> So I'd limit this to replacing $out only.
> The problem of infinite recursion can/will reappear
> no matter value ${out} has, as its intrinsic to lazy evaluation.
Sorry, I should've write the proposal in more details in the first message. 
I know that nix language cannot replace ${out}. I think that I've found a 
good workaround for this problem.

>From nix-build(1):
    nix-build is essentially a wrapper around
        nix-instantiate (to translate a high-level Nix expression to a
            low-level store derivation) and
        nix-store --realise (to build the store derivation).

If the proposal will be accepted, one will be able to write
derivation { configureFlags="--with-plugins=\${out}/lib/plugins"; } 
("\${out}", not "${out}").

nix-instantiate will write to the derivation file:
configureFlags="--with-plugins=${out}/lib/plugins"

$out will be calculated using this string, not /nix/store/path/lib/plugins.

nix-store --realise will replace ${out} with /nix/store/path before setting 
configureFlags environment variable for the builder.




More information about the nix-dev mailing list