summary refs log tree commit diff
path: root/pkgs/top-level/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2016-12-16 05:22:02 -0800
committerJohn Ericson <Ericson2314@Yahoo.com>2017-01-13 13:23:23 -0500
commit3e197f7d81130defacfe5bdad71ca5ebe63324ff (patch)
treed06650289f9729f647814eff912e8d39bdd523a8 /pkgs/top-level/default.nix
parent0ef8b69d12d1ab1574568f5660b44feba1f44179 (diff)
downloadnixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar
nixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.gz
nixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.bz2
nixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.lz
nixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.xz
nixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.zst
nixpkgs-3e197f7d81130defacfe5bdad71ca5ebe63324ff.zip
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.
Diffstat (limited to 'pkgs/top-level/default.nix')
-rw-r--r--pkgs/top-level/default.nix23
1 files changed, 13 insertions, 10 deletions
diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix
index db3abb531f1..04daf9778ff 100644
--- a/pkgs/top-level/default.nix
+++ b/pkgs/top-level/default.nix
@@ -7,11 +7,11 @@
 
      3. Defaults to no non-standard config and no cross-compilation target
 
-     4. Uses the above to infer the default standard environment (stdenv) if
-        none is provided
+     4. Uses the above to infer the default standard environment's (stdenv's)
+        stages if no stdenv's are provided
 
-     5. Builds the final stage --- a fully booted package set with the chosen
-        stdenv
+     5. Folds the stages to yield the final fully booted package set for the
+        chosen stdenv
 
    Use `impure.nix` to also infer the `system` based on the one on which
    evaluation is taking place, and the configuration from environment variables
@@ -23,9 +23,10 @@
 , # Allow a configuration attribute set to be passed in as an argument.
   config ? {}
 
-, # The standard environment for building packages, or rather a function
-  # providing it. See below for the arguments given to that function.
-  stdenvFunc ? import ../stdenv
+, # A function booting the final package set for a specific standard
+  # environment. See below for the arguments given to that function,
+  # the type of list it returns.
+  stdenvStages ? import ../stdenv
 
 , crossSystem ? null
 , platform ? assert false; null
@@ -76,10 +77,12 @@ in let
     inherit lib nixpkgsFun;
   } // newArgs);
 
-  stdenv = stdenvFunc {
-    inherit lib allPackages system platform crossSystem config;
+  boot = import ../stdenv/booter.nix { inherit lib allPackages; };
+
+  stages = stdenvStages {
+    inherit lib system platform crossSystem config;
   };
 
-  pkgs = allPackages { inherit system stdenv config crossSystem platform; };
+  pkgs = boot stages;
 
 in pkgs