From 3e197f7d81130defacfe5bdad71ca5ebe63324ff Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 16 Dec 2016 05:22:02 -0800 Subject: 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. --- pkgs/top-level/default.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'pkgs/top-level/default.nix') 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 -- cgit 1.4.1