summary refs log tree commit diff
path: root/pkgs/top-level
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
parent0ef8b69d12d1ab1574568f5660b44feba1f44179 (diff)
downloadnixlib-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar
nixlib-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.gz
nixlib-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.bz2
nixlib-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.lz
nixlib-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.xz
nixlib-3e197f7d81130defacfe5bdad71ca5ebe63324ff.tar.zst
nixlib-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')
-rw-r--r--pkgs/top-level/default.nix23
-rw-r--r--pkgs/top-level/stage.nix2
2 files changed, 14 insertions, 11 deletions
diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix
index db3abb531f19..04daf9778ffa 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
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 7c8860bf4e97..0b1326414b64 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -18,7 +18,7 @@
 , # This is used because stdenv replacement and the stdenvCross do benefit from
   # the overridden configuration provided by the user, as opposed to the normal
   # bootstrapping stdenvs.
-  allowCustomOverrides ? true
+  allowCustomOverrides
 
 , # Non-GNU/Linux OSes are currently "impure" platforms, with their libc
   # outside of the store.  Thus, GCC, GFortran, & co. must always look for