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.

_______________________________________________
nix-dev mailing list
nix-dev@cs.uu.nl
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to