summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/stdenv/custom/default.nix2
-rw-r--r--pkgs/stdenv/darwin/default.nix10
-rw-r--r--pkgs/stdenv/default.nix16
-rw-r--r--pkgs/stdenv/freebsd/default.nix8
-rw-r--r--pkgs/stdenv/linux/default.nix10
-rw-r--r--pkgs/stdenv/native/default.nix8
-rw-r--r--pkgs/top-level/stage.nix2
7 files changed, 31 insertions, 25 deletions
diff --git a/pkgs/stdenv/custom/default.nix b/pkgs/stdenv/custom/default.nix
index 174b8593c0a..188d0027773 100644
--- a/pkgs/stdenv/custom/default.nix
+++ b/pkgs/stdenv/custom/default.nix
@@ -2,6 +2,8 @@
 , system, platform, crossSystem, config
 }:
 
+assert crossSystem == null;
+
 rec {
   vanillaStdenv = import ../. {
     inherit lib allPackages system platform crossSystem;
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index 6182c8cc0c7..b9044f25cd7 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -1,7 +1,5 @@
-{ system         ? builtins.currentSystem
-, allPackages    ? import ../../..
-, platform       ? null
-, config         ? {}
+{ lib, allPackages
+, system, platform, crossSystem, config
 
 # Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
 , bootstrapFiles ? let
@@ -17,6 +15,8 @@
   }
 }:
 
+assert crossSystem == null;
+
 let
   libSystemProfile = ''
     (import "${./standard-sandbox.sb}")
@@ -100,7 +100,7 @@ in rec {
       };
 
       thisPkgs = allPackages {
-        inherit system platform config;
+        inherit system platform crossSystem config;
         allowCustomOverrides = false;
         stdenv = thisStdenv;
       };
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix
index 246e656f33b..3b49d0de830 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -9,7 +9,7 @@
   lib, allPackages
   # Args to pass on to `allPacakges` too
 , system, platform, crossSystem, config
-}:
+} @ args:
 
 let
   # The native (i.e., impure) build environment.  This one uses the
@@ -17,7 +17,7 @@ let
   # i.e., the stuff in /bin, /usr/bin, etc.  This environment should
   # be used with care, since many Nix packages will not build properly
   # with it (e.g., because they require GNU Make).
-  inherit (import ./native { inherit system allPackages config; }) stdenvNative;
+  inherit (import ./native args) stdenvNative;
 
   stdenvNativePkgs = allPackages {
     inherit system platform crossSystem config;
@@ -28,22 +28,22 @@ let
 
 
   # The Nix build environment.
-  stdenvNix = import ./nix {
+  stdenvNix = assert crossSystem == null; import ./nix {
     inherit config lib;
     stdenv = stdenvNative;
     pkgs = stdenvNativePkgs;
   };
 
-  inherit (import ./freebsd { inherit system allPackages platform config; }) stdenvFreeBSD;
+  inherit (import ./freebsd args) stdenvFreeBSD;
 
   # Linux standard environment.
-  inherit (import ./linux { inherit system allPackages platform config lib; }) stdenvLinux;
+  inherit (import ./linux args) stdenvLinux;
 
-  inherit (import ./darwin { inherit system allPackages platform config; }) stdenvDarwin;
+  inherit (import ./darwin args) stdenvDarwin;
 
-  inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross stdenvCrossiOS;
+  inherit (import ./cross args) stdenvCross stdenvCrossiOS;
 
-  inherit (import ./custom { inherit system allPackages platform crossSystem config lib; }) stdenvCustom;
+  inherit (import ./custom args) stdenvCustom;
 
   # Select the appropriate stdenv for the platform `system'.
 in
diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix
index 13cb21fe1d8..ea2ebcc7917 100644
--- a/pkgs/stdenv/freebsd/default.nix
+++ b/pkgs/stdenv/freebsd/default.nix
@@ -1,9 +1,9 @@
-{ system      ? builtins.currentSystem
-, allPackages ? import ../../..
-, platform    ? null
-, config      ? {}
+{ lib, allPackages
+, system, platform, crossSystem, config
 }:
 
+assert crossSystem == null;
+
 rec {
   inherit allPackages;
 
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index e4bf87c5202..34196359f52 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -3,11 +3,9 @@
 # external (non-Nix) tools, such as /usr/bin/gcc, and it contains a C
 # compiler and linker that do not search in default locations,
 # ensuring purity of components produced by it.
+{ lib, allPackages
+, system, platform, crossSystem, config
 
-# The function defaults are for easy testing.
-{ system ? builtins.currentSystem
-, allPackages ? import ../../..
-, platform ? null, config ? {}, lib ? (import ../../../lib)
 , bootstrapFiles ?
     if system == "i686-linux" then import ./bootstrap/i686.nix
     else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix
@@ -18,6 +16,8 @@
     else abort "unsupported platform for the pure Linux stdenv"
 }:
 
+assert crossSystem == null;
+
 rec {
 
   commonPreHook =
@@ -106,7 +106,7 @@ rec {
       };
 
       thisPkgs = allPackages {
-        inherit system platform config;
+        inherit system platform crossSystem config;
         allowCustomOverrides = false;
         stdenv = thisStdenv;
       };
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index 0f9aee214b3..8396bd0cb01 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -1,4 +1,8 @@
-{ system, allPackages ? import ../../.., config }:
+{ lib, allPackages
+, system, platform, crossSystem, config
+}:
+
+assert crossSystem == null;
 
 rec {
 
@@ -126,7 +130,7 @@ rec {
   } // {inherit fetchurl;};
 
   stdenvBoot1Pkgs = allPackages {
-    inherit system platform config;
+    inherit system platform crossSystem config;
     allowCustomOverrides = false;
     stdenv = stdenvBoot1;
   };
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 0c621b81c7e..1d6305151ca 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -30,7 +30,7 @@
 , # The configuration attribute set
   config
 
-, crossSystem ? null
+, crossSystem
 , platform
 , lib
 , nixpkgsFun