From ae5b3bdb05e9e9eec76603a19274bc4be59c57de Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 26 Oct 2025 21:57:51 +0800 Subject: [PATCH] fetchgit: restructure with lib.extendMkDerivation (not formatted) --- pkgs/build-support/fetchgit/default.nix | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index a620f6c09a00..0efeed065589 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -23,6 +23,21 @@ let in lib.makeOverridable ( + lib.extendMkDerivation { + constructDrv = stdenvNoCC.mkDerivation; + + excludeDrvArgNames = [ + # Passed via `passthru` + "tag" + + # Hashes, handled by `lib.fetchers.withNormalizedHash` + # whose outputs contain outputHash* attributes. + "hash" + "sha256" + ]; + + extendDrvArgs = + finalAttrs: lib.fetchers.withNormalizedHash { } ( # NOTE Please document parameter additions or changes in # ../../../doc/build-helpers/fetchers.chapter.md @@ -120,7 +135,7 @@ lib.makeOverridable ( throw "Please provide directories/patterns for sparse checkout as a list of strings. Passing a (multi-line) string is not supported any more." else - stdenvNoCC.mkDerivation { + { inherit name; builder = ./builder.sh; @@ -199,5 +214,9 @@ lib.makeOverridable ( } // passthru; } - ) + ); + + # No ellipsis. + inheritFunctionArgs = false; + } )