From 2e3744d31b990248f277d16a11ef81753b366f0f Mon Sep 17 00:00:00 2001 From: isabel Date: Fri, 22 May 2026 20:54:31 +0100 Subject: [PATCH] perf: fetchzip overides only once --- fetcher.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fetcher.nix b/fetcher.nix index 6e294e6..5641a69 100644 --- a/fetcher.nix +++ b/fetcher.nix @@ -7,7 +7,7 @@ repoRevToNameMaybe, fetchgit, fetchzip, -}: +}@args: let @@ -36,6 +36,9 @@ let decorate = f: lib.makeOverridable (adjustFunctionArgs f); + fetchzip = + if args.fetchzip ? override then args.fetchzip.override { withUnzip = false; } else args.fetchzip; + in decorate ( @@ -105,14 +108,7 @@ decorate ( # We prefer fetchzip in cases we don't need submodules as the hash # is more stable in that case. - 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; + fetcher = if useFetchGit then fetchgit else fetchzip; fetcherArgs = finalAttrs: -- 2.51.2