summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-07-05 19:58:24 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-07-07 12:16:51 -0400
commitafc20239939829490e2d7a3beb7028b7c1dcc803 (patch)
treed6e666f18004ed5407ba09c593100bd767a69067 /pkgs
parent4cf4d7180dfb7dba21e1dc832539daa5d31e2a23 (diff)
downloadnixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.tar
nixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.tar.gz
nixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.tar.bz2
nixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.tar.lz
nixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.tar.xz
nixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.tar.zst
nixlib-afc20239939829490e2d7a3beb7028b7c1dcc803.zip
stdenv: Have mkDerivation pull the "extra" arguments from stdenv instead
Something more elaborate is needed for the "*Platform" arguments.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/stdenv/generic/default.nix5
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix11
2 files changed, 6 insertions, 10 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 1d4425f9c789..d7b736a12e56 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -71,6 +71,8 @@ let
         platforms = lib.platforms.all;
       };
 
+      inherit extraBuildInputs __extraImpureHostDeps extraSandboxProfile;
+
       # Utility flags to test the type of platform.
       inherit (hostPlatform)
         isDarwin isLinux isSunOS isHurd isCygwin isFreeBSD isOpenBSD
@@ -85,9 +87,6 @@ let
         inherit lib config stdenv;
         # TODO(@Ericson2314): Remove
         inherit
-          extraBuildInputs
-          __extraImpureHostDeps
-          extraSandboxProfile
           hostPlatform targetPlatform;
       }) mkDerivation;
 
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 92d5d2a3d9d3..ec48e5374139 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -1,9 +1,6 @@
 { lib, config, stdenv
 
 # TODO(@Ericson2314): get off stdenv
-, extraBuildInputs
-, __extraImpureHostDeps
-, extraSandboxProfile
 , hostPlatform, targetPlatform
 }:
 
@@ -73,11 +70,11 @@ rec {
         // (let
           # TODO(@Ericson2314): Reversing of dep lists is just temporary to avoid Darwin mass rebuild.
           computedSandboxProfile =
-            lib.concatMap (input: input.__propagatedSandboxProfile or []) (extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies'));
+            lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies'));
           computedPropagatedSandboxProfile =
             lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists (lib.reverseList propagatedDependencies'));
           computedImpureHostDeps =
-            lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies')));
+            lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies')));
           computedPropagatedImpureHostDeps =
             lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists (lib.reverseList propagatedDependencies')));
         in
@@ -97,11 +94,11 @@ rec {
         } // lib.optionalAttrs (hostPlatform.isDarwin) {
           # TODO: remove lib.unique once nix has a list canonicalization primitive
           __sandboxProfile =
-          let profiles = [ extraSandboxProfile ] ++ computedSandboxProfile ++ computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile sandboxProfile ];
+          let profiles = [ stdenv.extraSandboxProfile ] ++ computedSandboxProfile ++ computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile sandboxProfile ];
               final = lib.concatStringsSep "\n" (lib.filter (x: x != "") (lib.unique profiles));
           in final;
           __propagatedSandboxProfile = lib.unique (computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile ]);
-          __impureHostDeps = computedImpureHostDeps ++ computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps ++ __impureHostDeps ++ __extraImpureHostDeps ++ [
+          __impureHostDeps = computedImpureHostDeps ++ computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps ++ __impureHostDeps ++ stdenv.__extraImpureHostDeps ++ [
             "/dev/zero"
             "/dev/random"
             "/dev/urandom"