top-level: Normalize stdenv booting
Introduce new abstraction, `stdenv/booter.nix` for composing bootstraping stages, and use it everywhere for consistency. See that file for more doc. Stdenvs besides Linux and Darwin are completely refactored to utilize this. Those two, due to their size and complexity, are minimally edited for easier reviewing. No hashes should be changed.
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
{ lib, allPackages
|
||||
{ lib
|
||||
, system, platform, crossSystem, config
|
||||
}:
|
||||
|
||||
assert crossSystem == null;
|
||||
|
||||
rec {
|
||||
vanillaStdenv = import ../. {
|
||||
inherit lib allPackages system platform crossSystem;
|
||||
let
|
||||
bootStages = import ../. {
|
||||
inherit lib system platform crossSystem;
|
||||
# Remove config.replaceStdenv to ensure termination.
|
||||
config = builtins.removeAttrs config [ "replaceStdenv" ];
|
||||
};
|
||||
|
||||
buildPackages = allPackages {
|
||||
inherit system platform crossSystem config;
|
||||
# It's OK to change the built-time dependencies
|
||||
allowCustomOverrides = true;
|
||||
stdenv = vanillaStdenv;
|
||||
};
|
||||
in bootStages ++ [
|
||||
|
||||
stdenvCustom = config.replaceStdenv { pkgs = buildPackages; };
|
||||
}
|
||||
# Additional stage, built using custom stdenv
|
||||
(vanillaPackages: {
|
||||
inherit system platform crossSystem config;
|
||||
stdenv = config.replaceStdenv { pkgs = vanillaPackages; };
|
||||
})
|
||||
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user