diff --git a/pkgs/stdenv/generic/builder.sh b/pkgs/stdenv/generic/builder.sh index fd4c17ca251..81e11c2df65 100644 --- a/pkgs/stdenv/generic/builder.sh +++ b/pkgs/stdenv/generic/builder.sh @@ -13,6 +13,10 @@ sed -e "s^@initialPath@^$initialPath^g" \ -e "s^@gcc@^$gcc^g" \ -e "s^@shell@^$shell^g" \ < $out/setup > $out/setup.tmp +if [ -n "$withNixImpure" ]; then + sed -i -e 's^@niximpure@^test -f /niximupure/impure.sh && . /niximpure/impure.sh^g' \ + $out/setup.tmp +fi mv $out/setup.tmp $out/setup # Allow the user to install stdenv using nix-env and get the packages diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 20cbb1b455c..0494d6f00f5 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -1,5 +1,6 @@ { system, name ? "stdenv", preHook ? "", initialPath, gcc, shell , extraAttrs ? {}, overrides ? (pkgs: {}) +, withNixImpure ? false , # The `fetchurl' to use for downloading curl and its dependencies # (see all-packages.nix). @@ -26,7 +27,7 @@ let setup = setupScript; - inherit preHook initialPath gcc shell; + inherit preHook initialPath gcc shell withNixImpure; propagatedUserEnvPkgs = [gcc] ++ lib.filter lib.isDerivation initialPath; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index e30b0656e62..230694ccf35 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -270,6 +270,7 @@ elif [ "$NIX_BUILD_CORES" -le 0 ]; then fi export NIX_BUILD_CORES +@niximpure@ ###################################################################### # Misc. helper functions. diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 3105e76f817..df89b3714f8 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -264,7 +264,7 @@ rec { inherit system; preHook = commonPreHook; - + initialPath = ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;}) ++ [stdenvLinuxBoot4Pkgs.patchelf]; @@ -281,6 +281,8 @@ rec { shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; fetchurlBoot = fetchurl; + + withNixImpure = if platform ? nixImpure then platform.nixImpure else false; extraAttrs = { inherit (stdenvLinuxBoot3Pkgs) glibc;