diff --git a/maintainers/scripts/eval-release.nix b/maintainers/scripts/eval-release.nix index 3d4458699c74..836e4312c448 100644 --- a/maintainers/scripts/eval-release.nix +++ b/maintainers/scripts/eval-release.nix @@ -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) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2ef33a44e026..556f6afc04aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -177,7 +177,7 @@ let # 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