about summary refs log tree commit diff
path: root/pkgs/by-name/gi/git-toolbelt/package.nix
blob: c4a33f7f3791652fe272a5b401c5072f25c93453 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  makeWrapper,
  git,
  fzf,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "git-toolbelt";
  version = "1.9.1";

  src = fetchFromGitHub {
    owner = "nvie";
    repo = "git-toolbelt";
    rev = "v${finalAttrs.version}";
    hash = "sha256-lrVMSItA0Eo7DgB+QjOLPPxwMLaC9+6FNPrhw6pkpKA=";
  };

  nativeBuildInputs = [ makeWrapper ];

  buildInputs = [
    git
    fzf # needed by git-fixup-with
  ];

  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
  '';

  meta = {
    changelog = "https://github.com/nvie/git-toolbelt/blob/${finalAttrs.src.rev}/CHANGELOG.md";
    description = "A suite of useful Git commands that aid with scripting or every day command line usage";
    homepage = "https://github.com/nvie/git-toolbelt";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ tomasajt ];
    platforms = lib.platforms.all;
  };
})