Author: eelco
Date: Thu Jan 12 16:59:58 2012
New Revision: 31500
URL: https://nixos.org/websvn/nix/?rev=31500&sc=1

Log:
* eval-release.nix: force nix-instantiate to include nested attribute
  sets.

Modified:
   nixpkgs/trunk/maintainers/scripts/eval-release.nix
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Modified: nixpkgs/trunk/maintainers/scripts/eval-release.nix
==============================================================================
--- nixpkgs/trunk/maintainers/scripts/eval-release.nix  Thu Jan 12 15:21:22 
2012        (r31499)
+++ nixpkgs/trunk/maintainers/scripts/eval-release.nix  Thu Jan 12 16:59:58 
2012        (r31500)
@@ -2,23 +2,30 @@
 # attribute with the expected `system' argument).  Too bad
 # nix-instantiate can't to do this.
 
-let
+with import ../../pkgs/lib;
 
-  lib = (import ../.. {}).lib;
+let
 
   rel = removeAttrs (import ../../pkgs/top-level/release.nix) [ "tarball" 
"xbursttools" ];
 
-  seqList = xs: res: lib.fold (x: xs: lib.seq x xs) res xs;
+  seqList = xs: res: fold (x: xs: seq x xs) res xs;
   
-  strictAttrs = as: seqList (lib.attrValues as) as;
+  strictAttrs = as: seqList (attrValues as) as;
 
   maybe = as: let y = builtins.tryEval (strictAttrs as); in if y.success then 
y.value else builtins.trace "FAIL" null;
 
-  call = attrs: lib.flip lib.mapAttrs attrs
-    (n: v: builtins.trace n (
+  call = attrs: flip mapAttrs attrs
+    (n: v: /* builtins.trace n */ (
       if builtins.isFunction v then maybe (v { system = "i686-linux"; })
       else if builtins.isAttrs v then call v
       else null
     ));
 
-in call rel
+  # Add the ‘recurseForDerivations’ attribute to ensure that
+  # nix-instantiate recurses into nested attribute sets.
+  recurse = attrs:
+    if isDerivation attrs
+    then attrs
+    else { recurseForDerivations = true; } // mapAttrs (n: v: recurse v) attrs;
+
+in recurse (call rel)

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix       Thu Jan 12 15:21:22 
2012        (r31499)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix       Thu Jan 12 16:59:58 
2012        (r31500)
@@ -177,7 +177,7 @@
 
   # Applying this to an attribute set will cause nix-env to look
   # inside the set for derivations.
-  recurseIntoAttrs = attrs: attrs // {recurseForDerivations = true;};
+  recurseIntoAttrs = attrs: attrs // { recurseForDerivations = true; };
 
   builderDefs = lib.composedArgsAndFun (import 
../build-support/builder-defs/builder-defs.nix) {
     inherit stringsWithDeps lib stdenv writeScript
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to