From 3a99d1b6424cb4b9c431bec279ee6c832b16948f Mon Sep 17 00:00:00 2001 From: Elliot Cameron Date: Fri, 10 Nov 2023 14:52:31 -0500 Subject: nix-prefetch-git: respect NETRC This script needs to support being run both as part of a `fetchgit` derivation and as a standalone, command-line tool. The use of `$NIX_BUILD_TOP` only works when used in `fetchgit` but not when invoked as a standalone tool. Instead we try to respect `$NETRC` so that the command-line invocation behaves more like standard tools and the `fetchgit` derivation can explicitly set `$NETRC` when `netrcPhase` is used to avoid all ambiguity. --- pkgs/build-support/fetchgit/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'pkgs/build-support/fetchgit/default.nix') diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 1d06ce44a91..66bb3b7c09f 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 ''; -- cgit 1.4.1