diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2016-11-27 12:37:45 -0800 |
---|---|---|
committer | John Ericson <jericson@galois.com> | 2016-11-30 19:11:03 -0500 |
commit | 39753f5360134f1aab1a949260374a876c0983eb (patch) | |
tree | 02dc06e81131d21218526443b19b96773a75896d /pkgs/stdenv | |
parent | d240a0da1ab03ef8838553229b72b9b37a0ef3e7 (diff) |
top-level: Close over fewer arguments for stdenv stages
This makes the flow of data easier to understand. There's little downside because the args in question are already inspected by the stdenvs. cross-compiling in particular is simpler because we don't need to worry about overriding the config closed over by `allPackages`.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/cross/default.nix | 12 | ||||
-rw-r--r-- | pkgs/stdenv/custom/default.nix | 9 | ||||
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/default.nix | 10 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/native/default.nix | 2 |
6 files changed, 21 insertions, 16 deletions
diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix index fcf06bcf1daf4..10e2a7663563f 100644 --- a/pkgs/stdenv/cross/default.nix +++ b/pkgs/stdenv/cross/default.nix @@ -1,14 +1,14 @@ -{ system, allPackages, platform, crossSystem, config, ... } @ args: +{ lib, allPackages +, system, platform, crossSystem, config +}: rec { - argClobber = { + vanillaStdenv = (import ../. { + inherit lib allPackages system platform; crossSystem = null; # Ignore custom stdenvs when cross compiling for compatability config = builtins.removeAttrs config [ "replaceStdenv" ]; - }; - vanillaStdenv = (import ../. (args // argClobber // { - allPackages = args: allPackages (argClobber // args); - })) // { + }) // { # Needed elsewhere as a hacky way to pass the target cross = crossSystem; }; diff --git a/pkgs/stdenv/custom/default.nix b/pkgs/stdenv/custom/default.nix index e8f203d69cf81..174b8593c0aab 100644 --- a/pkgs/stdenv/custom/default.nix +++ b/pkgs/stdenv/custom/default.nix @@ -1,10 +1,13 @@ -{ system, allPackages, platform, crossSystem, config, ... } @ args: +{ lib, allPackages +, system, platform, crossSystem, config +}: rec { - vanillaStdenv = import ../. (args // { + vanillaStdenv = import ../. { + inherit lib allPackages system platform crossSystem; # Remove config.replaceStdenv to ensure termination. config = builtins.removeAttrs config [ "replaceStdenv" ]; - }); + }; buildPackages = allPackages { inherit system platform crossSystem config; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 49c4d9b8b2bc9..6182c8cc0c743 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -100,7 +100,7 @@ in rec { }; thisPkgs = allPackages { - inherit system platform; + inherit system platform config; allowCustomOverrides = false; stdenv = thisStdenv; }; diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index bd515181fc6e8..246e656f33bf1 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -5,12 +5,13 @@ # Posix utilities, the GNU C compiler, and so on. On other systems, # we use the native C library. -{ system, allPackages ? import ../top-level, platform, config, crossSystem, lib }: - +{ # Args just for stdenvs' usage + lib, allPackages + # Args to pass on to `allPacakges` too +, system, platform, crossSystem, config +}: let - - # The native (i.e., impure) build environment. This one uses the # tools installed on the system outside of the Nix environment, # i.e., the stuff in /bin, /usr/bin, etc. This environment should @@ -19,6 +20,7 @@ let inherit (import ./native { inherit system allPackages config; }) stdenvNative; stdenvNativePkgs = allPackages { + inherit system platform crossSystem config; allowCustomOverrides = false; stdenv = stdenvNative; noSysDirs = false; diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index e0a68bdca2f3f..e4bf87c520249 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -106,7 +106,7 @@ rec { }; thisPkgs = allPackages { - inherit system platform; + inherit system platform config; allowCustomOverrides = false; stdenv = thisStdenv; }; diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index 22b4dc1400fee..0f9aee214b30f 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -126,7 +126,7 @@ rec { } // {inherit fetchurl;}; stdenvBoot1Pkgs = allPackages { - inherit system; + inherit system platform config; allowCustomOverrides = false; stdenv = stdenvBoot1; }; |