stdenv: implement crossOverlays

crossOverlays only apply to the packages being built, not the build
packages. It is useful when you don’t care what is used to build your
packages, just what is being built. The idea relies heavily on the
cross compiling infrastructure. Using this implies that we need to
create a cross stdenv.
This commit is contained in:
Matthew Bauer
2018-12-04 21:06:46 -06:00
parent 9d8de9ffaa
commit a3a6ad7a01
9 changed files with 28 additions and 20 deletions
+8 -5
View File
@@ -22,9 +22,8 @@
# `*Platform`s.
localSystem
, # The system packages will ultimately be run on. Null if the two should be the
# same.
crossSystem ? null
, # The system packages will ultimately be run on.
crossSystem ? localSystem
, # Allow a configuration attribute set to be passed in as an argument.
config ? {}
@@ -32,6 +31,9 @@
, # List of overlays layers used to extend Nixpkgs.
overlays ? []
, # List of overlays to apply to target packages only.
crossOverlays ? []
, # 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.
@@ -61,7 +63,8 @@ in let
builtins.intersectAttrs { platform = null; } config
// args.localSystem);
crossSystem = lib.mapNullable lib.systems.elaborate crossSystem0;
crossSystem = if crossSystem0 == null then localSystem
else lib.systems.elaborate crossSystem0;
# A few packages make a new package set to draw their dependencies from.
# (Currently to get a cross tool chain, or forced-i686 package.) Rather than
@@ -91,7 +94,7 @@ in let
boot = import ../stdenv/booter.nix { inherit lib allPackages; };
stages = stdenvStages {
inherit lib localSystem crossSystem config overlays;
inherit lib localSystem crossSystem config overlays crossOverlays;
};
pkgs = boot stages;