From a2fa54fa679ed498e9dfe1a152ce91a7c1e81911 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:21:13 +0100 Subject: [PATCH] fetchFromGitHub: fix compatibility issue with nix-prefetch --- pkgs/build-support/fetchgithub/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index 37f7dcfa3006..4ce3c6e84d76 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -28,7 +28,11 @@ let useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != []); # We prefer fetchzip in cases we don't need submodules as the hash # is more stable in that case. - fetcher = if useFetchGit then fetchgit else fetchzip.override { withUnzip = false; }; + fetcher = + if useFetchGit then fetchgit + # fetchzip may not be overridable when using external tools, for example nix-prefetch + else if fetchzip ? override then fetchzip.override { withUnzip = false; } + else fetchzip; privateAttrs = lib.optionalAttrs private { netrcPhase = '' if [ -z "''$${varBase}USERNAME" -o -z "''$${varBase}PASSWORD" ]; then