@@ -12,6 +12,11 @@
1212 # null, the default standard environment is used.
1313 bootStdenv ? null
1414
15+, # This is used because stdenv replacement and the stdenvCross do benefit from
16+ # the overridden configuration provided by the user, as opposed to the normal
17+ # bootstrapping stdenvs.
18+ allowCustomOverrides ? (bootStdenv == null)
19+
1520, # Non-GNU/Linux OSes are currently "impure" platforms, with their libc
1621 # outside of the store. Thus, GCC, GFortran, & co. must always look for
1722 # files in standard system directories (/usr/include, etc.)
@@ -56,10 +61,6 @@ let
5661 platform = if platform_ != null then platform_
5762 else config.platform or platformAuto;
5863
59− topLevelArguments = {
60− inherit system bootStdenv noSysDirs config crossSystem platform lib nixpkgsFun;
61− };
62−
6364 # A few packages make a new package set to draw their dependencies from.
6465 # (Currently to get a cross tool chain, or forced-i686 package.) Rather than
6566 # give `all-packages.nix` all the arguments to this function, even ones that
@@ -77,14 +78,19 @@ let
7778 };
7879
7980 trivialBuilders = self: super:
80− (import ../build-support/trivial-builders.nix {
81+ import ../build-support/trivial-builders.nix {
8182 inherit lib; inherit (self) stdenv stdenvNoCC; inherit (self.xorg) lndir;
82− });
83+ };
8384
84− stdenvDefault = self: super: (import ./stdenv.nix topLevelArguments) pkgs;
85+ stdenvDefault = self: super:
86+ import ./stdenv.nix {
87+ inherit system bootStdenv crossSystem config platform lib nixpkgsFun;
88+ };
8589
8690 allPackages = self: super:
87− let res = import ./all-packages.nix topLevelArguments res self;
91+ let res = import ./all-packages.nix
92+ { inherit system noSysDirs config crossSystem platform lib nixpkgsFun; }
93+ res self;
8894 in res;
8995
9096 aliases = self: super: import ./aliases.nix super;
@@ -108,7 +114,7 @@ let
108114 # attributes to refer to the original attributes (e.g. "foo =
109115 # ... pkgs.foo ...").
110116 configOverrides = self: super:
111− lib.optionalAttrs (bootStdenv == null)
117+ lib.optionalAttrs allowCustomOverrides
112118 ((config.packageOverrides or (super: {})) super);
113119
114120 # The complete chain of package set builders, applied from top to bottom