diff --git a/pkgs/lib/attrsets.nix b/pkgs/lib/attrsets.nix index 3be143d6a217..1348a15bdba6 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 16e232f586c6..23cc2a0775f5 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 cf3bbe7e5f66..1a1f588c16aa 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 757a475568f5..90444a96d76c 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;