From c7a9f51e5f3fb271cecf055a9b2388832b1c9a30 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 29 Oct 2025 23:58:01 +0100 Subject: [PATCH] git-tools: init at 2025.08 --- pkgs/by-name/gi/git-tools/package.nix | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 pkgs/by-name/gi/git-tools/package.nix diff --git a/pkgs/by-name/gi/git-tools/package.nix b/pkgs/by-name/gi/git-tools/package.nix new file mode 100644 index 000000000000..ca96ce256e8a --- /dev/null +++ b/pkgs/by-name/gi/git-tools/package.nix @@ -0,0 +1,69 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + makeWrapper, + installShellFiles, + versionCheckHook, + nix-update-script, + bash, + git, + python3, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "git-tools"; + version = "2025.08"; + + src = fetchFromGitHub { + owner = "MestreLion"; + repo = "git-tools"; + tag = "v${finalAttrs.version}"; + hash = "sha256-DuhvepcDXk+UTFbvmv5V/EGP9ZEnHBYk7ARm/z0gTLY="; + }; + + nativeBuildInputs = [ + makeWrapper + installShellFiles + ]; + + buildInputs = [ + bash + git + python3 + ]; + + installPhase = '' + runHook preInstall + + install -Dm755 git-* -t "$out"/bin + + for exe in "$out"/bin/*; do + wrapProgram "$exe" \ + --prefix PATH : "$out"/bin:${lib.makeBinPath finalAttrs.buildInputs} + done + + runHook postInstall + ''; + postInstall = '' + installManPage \ + man1/*.1 + ''; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + versionCheckProgram = "${placeholder "out"}/bin/git-restore-mtime"; + + passthru.updateScript = nix-update-script { }; + + meta = { + changelog = "https://github.com/MestreLion/git-tools/blob/${finalAttrs.src.rev}/CHANGELOG.md"; + description = "Assorted git tools, including git-restore-mtime"; + homepage = "https://github.com/MestreLion/git-tools"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ aduh95 ]; + platforms = lib.platforms.all; + }; +})