From 348bfd5f6d7b195a3b656f68f43f3f7618e0db62 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 2 Mar 2026 02:23:10 +0000 Subject: [PATCH] tests.fetchgit.withGitConfig: fix build --- pkgs/build-support/fetchgit/tests.nix | 31 +++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/pkgs/build-support/fetchgit/tests.nix b/pkgs/build-support/fetchgit/tests.nix index a2f620b4b638..25bb55ed53bf 100644 --- a/pkgs/build-support/fetchgit/tests.nix +++ b/pkgs/build-support/fetchgit/tests.nix @@ -1,6 +1,5 @@ { - stdenv, - config, + lib, runCommand, testers, fetchgit, @@ -238,21 +237,15 @@ hash = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY="; }; - withGitConfig = - let - pkgs = import ../../.. { - system = stdenv.hostPlatform.system; - config = config // { - gitConfig = { - url."https://github.com".insteadOf = "https://doesntexist.forsure"; - }; - }; - }; - in - pkgs.testers.invalidateFetcherByDrvHash pkgs.fetchgit { - name = "fetchgit-with-config"; - url = "https://doesntexist.forsure/NixOS/nix"; - rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a"; - sha256 = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY="; - }; + withGitConfig = testers.invalidateFetcherByDrvHash fetchgit { + name = "fetchgit-with-config"; + url = "https://doesntexist.forsure/NixOS/nix"; + rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a"; + sha256 = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY="; + gitConfigFile = lib.toFile "gitconfig" ( + lib.generators.toGitINI { + url."https://github.com".insteadOf = "https://doesntexist.forsure"; + } + ); + }; }