summary refs log tree commit diff
path: root/pkgs/top-level/default.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-12-04 21:06:46 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2018-12-04 21:06:46 -0600
commita3a6ad7a01e943a4097c87cb144d331910693d82 (patch)
tree2f45f710bebba782423e8b64a71ba3c44e9af046 /pkgs/top-level/default.nix
parent9d8de9ffaa1bcdd4dc54b0e40666f0c42026a43c (diff)
downloadnixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.tar
nixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.tar.gz
nixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.tar.bz2
nixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.tar.lz
nixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.tar.xz
nixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.tar.zst
nixpkgs-a3a6ad7a01e943a4097c87cb144d331910693d82.zip
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.
Diffstat (limited to 'pkgs/top-level/default.nix')
-rw-r--r--pkgs/top-level/default.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix
index da7fc1bed34..dcd443a1c29 100644
--- a/pkgs/top-level/default.nix
+++ b/pkgs/top-level/default.nix
@@ -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;