diff options
-rw-r--r-- | pkgs/build-support/fetchgit/default.nix | 1 | ||||
-rwxr-xr-x | pkgs/build-support/fetchgit/nix-prefetch-git | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 1d06ce44a91e..66bb3b7c09ff 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -90,6 +90,7 @@ stdenvNoCC.mkDerivation { ${netrcPhase} # required that git uses the netrc file mv {,.}netrc + export NETRC=$PWD/.netrc export HOME=$PWD ''; diff --git a/pkgs/build-support/fetchgit/nix-prefetch-git b/pkgs/build-support/fetchgit/nix-prefetch-git index e02b2ea7fbc2..ae3d28cc2319 100755 --- a/pkgs/build-support/fetchgit/nix-prefetch-git +++ b/pkgs/build-support/fetchgit/nix-prefetch-git @@ -425,8 +425,8 @@ fi tmpHomePath="$(mktemp -d "${TMPDIR:-/tmp}/nix-prefetch-git-tmp-home-XXXXXXXXXX")" exit_handlers+=(remove_tmpHomePath) +ln -s "${NETRC:-$HOME/.netrc}" "$tmpHomePath/.netrc" HOME="$tmpHomePath" -ln -s "$NIX_BUILD_TOP/.netrc" "$HOME/" unset XDG_CONFIG_HOME export GIT_CONFIG_NOSYSTEM=1 |