From fb84fe6d6f90f61d354a43f39b023b1922d73be4 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Tue, 19 May 2026 22:04:44 -0400 Subject: [PATCH] lib.fetchers.withNormalizedHash: share removed attributes for every call --- lib/fetchers.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/fetchers.nix b/lib/fetchers.nix index 36178ef7acf9..0f4192cc6822 100644 --- a/lib/fetchers.nix +++ b/lib/fetchers.nix @@ -199,6 +199,12 @@ rec { and is implemented somewhat more efficiently. */ withNormalizedHash = + let + removedAttributes = [ + "outputHash" + "outputHashAlgo" + ]; + in { hashTypes ? defaultHashTypes, }: @@ -219,10 +225,7 @@ rec { assert intersectAttrs fArgs hashSet == { }; setFunctionArgs (args: fetcher (normalize args)) ( - removeAttrs fArgs [ - "outputHash" - "outputHashAlgo" - ] + removeAttrs fArgs removedAttributes // { hash = fArgs.outputHash; }