[Nix-dev] Should I revert my last Eclipse patch or shall I extend the expression?
Marc Weber
marco-oweber at gmx.de
Fri Apr 23 18:30:54 CEST 2010
Which is the best way to revert my Eclipse change?
I'd like to introduce this:
{ [...], version ? "3.5.0" }: # << adding vesrion defaulting to 3.5.0
let
sources = {
"3.5.0-i686-linux" = fetchurl ..;
"3.5.0-i686-linux" = fetchurl ..;
# note: not all plugins can be used with this version yet:
"3.5.2-x86_64" = fetchurl ..;
"3.5.2-x86_64" = fetchurl ..;
[..]
}
in ... {
src =
let key = "${version}-{stdenv.system}";
stdenv.lib.maybeAttr key (throw "no source given for ${key}") sources;
[ ... ]
}
Then you can override version only to select a specific version.
However the syntax using strings as keys is only possible using
listToAttr at the moment.
Eelco Dolstra: are you interested in helping me extend Nix allowing
arbitrary strings as attr names?
I failed in the past. I got a segfault I couldn't cope with.
Marc Weber
More information about the nix-dev
mailing list