Changed syntax of getVersion

svn path=/nixpkgs/branches/stdenv-updates/; revision=9733
This commit is contained in:
Yury G. Kudryashov 2007-11-17 14:05:39 +00:00
parent 07091eed11
commit ebc6bb79cd
2 changed files with 9 additions and 10 deletions

View file

@ -1,8 +1,7 @@
args:
rec {
recurseForDerivations = true;
default = v_0_14_6;
v_0_14_6 = (import ./0.14.6.nix) args;
v_0_15 = (import ./0.15.nix) args;
v_0_16_x = (import ./0.16.x.nix) args;
}
builtins.listToAttrs [
{ name = "recurseForDerivations"; value = true; }
{ name = "0.14.6"; value = (import ./0.14.6.nix) args; }
{ name = "0.15"; value = (import ./0.15.nix) args; }
{ name = "0.16.x"; value = (import ./0.16.x.nix) args; }
]

View file

@ -142,10 +142,10 @@ rec {
# pkgname = getVersion "name" pkgname_alts;
#
# user will be able to write in his configuration.nix something like
# environment = { versions = { name = v_0_2; }; }; and pkgname will be equal
# to pkgname_alts.v_0_2. Using alts.default by default.
# name = { version = "0.2"; }; and pkgname will be equal
# to getAttr pkgname_alts "0.2". Using alts.default by default.
getVersion = name: alts: builtins.getAttr
(getConfig [ "environment" "versions" name ] "default") alts;
(getConfig [ name "version" ] "default") alts;
# The same, another syntax.
# Warning: syntax for configuration.nix changed too