diff --git a/pkgs/lib/attrsets.nix b/pkgs/lib/attrsets.nix index 3be143d6a21..1348a15bdba 100644 --- a/pkgs/lib/attrsets.nix +++ b/pkgs/lib/attrsets.nix @@ -123,5 +123,9 @@ rec { else f (path ++ [name]) value; in mapAttrs g set; in recurse [] set; - + + + /* Check whether the argument is a derivation. */ + isDerivation = x: isAttrs x && x ? type && x.type == "derivation"; + } diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index 16e232f586c..23cc2a0775f 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -30,3 +30,8 @@ sed \ -e "s^@param4@^$p4^g" \ -e "s^@param5@^$p5^g" \ < "$setup" > "$out/setup" + +# Allow the user to install stdenv using nix-env and get the packages +# in stdenv. +mkdir $out/nix-support +echo $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index cf3bbe7e5f6..1a1f588c16a 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -7,7 +7,9 @@ fetchurlBoot }: -let { +let + + lib = import ../../lib; stdenvGenerator = setupScript: rec { @@ -27,6 +29,9 @@ let { # TODO: make this more elegant. inherit param1 param2 param3 param4 param5; + + propagatedUserEnvPkgs = [gcc] ++ + lib.filter lib.isDerivation initialPath; } // { @@ -79,7 +84,7 @@ let { # For convenience, bring in the library functions in lib/ so # packages don't have to do that themselves. - lib = import ../../lib; + inherit lib; inherit fetchurlBoot; @@ -94,6 +99,4 @@ let { }.result; - body = stdenvGenerator ./setup.sh; - -} +in stdenvGenerator ./setup.sh diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 757a475568f..90444a96d76 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -205,10 +205,9 @@ rec { preHook = builtins.toFile "prehook.sh" commonPreHook; - initialPath = [ + initialPath = ((import ../common-path.nix) {pkgs = stdenvLinuxBoot3Pkgs;}) - stdenvLinuxBoot3Pkgs.patchelf - ]; + ++ [stdenvLinuxBoot3Pkgs.patchelf]; gcc = wrapGCC rec { inherit (stdenvLinuxBoot2Pkgs) binutils;