Hi,

On 07/01/12 18:24, Shea Levy wrote:

> Fairly frequently (especially when trying to get packages to build on 
> non-Linux platforms without affecting the build for Linux), I find 
> myself wishing for easier syntax for conditionally-existent attributes. 
> Right now, we have to do something like
> 
> {
>   a = 1;
> } // (if condition then { b = 2; } else {})

I've been thinking about a special ‘ignore’ value:

derivation {
  CFLAGS = if system == "i686-darwin" then "bla" else ignore;
}

This value would be like ‘null’, except that if a derivation attribute evaluates
to ‘ignore’, it wouldn't be added to the environment of the builder.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to