stdenv: Have mkDerivation pull the "extra" arguments from stdenv instead

Something more elaborate is needed for the "*Platform" arguments.

+6 -10
+2 -3
pkgs/stdenv/generic/default.nix
··· 71 platforms = lib.platforms.all; 72 }; 73 74 # Utility flags to test the type of platform. 75 inherit (hostPlatform) 76 isDarwin isLinux isSunOS isHurd isCygwin isFreeBSD isOpenBSD ··· 85 inherit lib config stdenv; 86 # TODO(@Ericson2314): Remove 87 inherit 88 - extraBuildInputs 89 - __extraImpureHostDeps 90 - extraSandboxProfile 91 hostPlatform targetPlatform; 92 }) mkDerivation; 93
··· 71 platforms = lib.platforms.all; 72 }; 73 74 + inherit extraBuildInputs __extraImpureHostDeps extraSandboxProfile; 75 + 76 # Utility flags to test the type of platform. 77 inherit (hostPlatform) 78 isDarwin isLinux isSunOS isHurd isCygwin isFreeBSD isOpenBSD ··· 87 inherit lib config stdenv; 88 # TODO(@Ericson2314): Remove 89 inherit 90 hostPlatform targetPlatform; 91 }) mkDerivation; 92
+4 -7
pkgs/stdenv/generic/make-derivation.nix
··· 1 { lib, config, stdenv 2 3 # TODO(@Ericson2314): get off stdenv 4 - , extraBuildInputs 5 - , __extraImpureHostDeps 6 - , extraSandboxProfile 7 , hostPlatform, targetPlatform 8 }: 9 ··· 73 // (let 74 # TODO(@Ericson2314): Reversing of dep lists is just temporary to avoid Darwin mass rebuild. 75 computedSandboxProfile = 76 - lib.concatMap (input: input.__propagatedSandboxProfile or []) (extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies')); 77 computedPropagatedSandboxProfile = 78 lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists (lib.reverseList propagatedDependencies')); 79 computedImpureHostDeps = 80 - lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies'))); 81 computedPropagatedImpureHostDeps = 82 lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists (lib.reverseList propagatedDependencies'))); 83 in ··· 97 } // lib.optionalAttrs (hostPlatform.isDarwin) { 98 # TODO: remove lib.unique once nix has a list canonicalization primitive 99 __sandboxProfile = 100 - let profiles = [ extraSandboxProfile ] ++ computedSandboxProfile ++ computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile sandboxProfile ]; 101 final = lib.concatStringsSep "\n" (lib.filter (x: x != "") (lib.unique profiles)); 102 in final; 103 __propagatedSandboxProfile = lib.unique (computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile ]); 104 - __impureHostDeps = computedImpureHostDeps ++ computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps ++ __impureHostDeps ++ __extraImpureHostDeps ++ [ 105 "/dev/zero" 106 "/dev/random" 107 "/dev/urandom"
··· 1 { lib, config, stdenv 2 3 # TODO(@Ericson2314): get off stdenv 4 , hostPlatform, targetPlatform 5 }: 6 ··· 70 // (let 71 # TODO(@Ericson2314): Reversing of dep lists is just temporary to avoid Darwin mass rebuild. 72 computedSandboxProfile = 73 + lib.concatMap (input: input.__propagatedSandboxProfile or []) (stdenv.extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies')); 74 computedPropagatedSandboxProfile = 75 lib.concatMap (input: input.__propagatedSandboxProfile or []) (lib.concatLists (lib.reverseList propagatedDependencies')); 76 computedImpureHostDeps = 77 + lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (stdenv.extraBuildInputs ++ lib.concatLists (lib.reverseList dependencies'))); 78 computedPropagatedImpureHostDeps = 79 lib.unique (lib.concatMap (input: input.__propagatedImpureHostDeps or []) (lib.concatLists (lib.reverseList propagatedDependencies'))); 80 in ··· 94 } // lib.optionalAttrs (hostPlatform.isDarwin) { 95 # TODO: remove lib.unique once nix has a list canonicalization primitive 96 __sandboxProfile = 97 + let profiles = [ stdenv.extraSandboxProfile ] ++ computedSandboxProfile ++ computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile sandboxProfile ]; 98 final = lib.concatStringsSep "\n" (lib.filter (x: x != "") (lib.unique profiles)); 99 in final; 100 __propagatedSandboxProfile = lib.unique (computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile ]); 101 + __impureHostDeps = computedImpureHostDeps ++ computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps ++ __impureHostDeps ++ stdenv.__extraImpureHostDeps ++ [ 102 "/dev/zero" 103 "/dev/random" 104 "/dev/urandom"