1{ lib, stdenv, fetchFromGitHub, rustPlatform, installShellFiles, Security }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "git-absorb";
5 version = "0.6.10";
6
7 src = fetchFromGitHub {
8 owner = "tummychow";
9 repo = pname;
10 rev = "refs/tags/${version}";
11 hash = "sha256-lFaiv9bgzu6XVcQuLXWoWsKl0cylfrF5rC0i3qj+zU0=";
12 };
13
14 nativeBuildInputs = [ installShellFiles ];
15
16 buildInputs = lib.optionals stdenv.isDarwin [ Security ];
17
18 cargoHash = "sha256-hksSyVdsGe/Ha3F5orL4W/k2nzFCuMqQjBgsT1jiWLw=";
19
20 postInstall = ''
21 installManPage Documentation/git-absorb.1
22 installShellCompletion --cmd git-absorb \
23 --bash <($out/bin/git-absorb --gen-completions bash) \
24 --fish <($out/bin/git-absorb --gen-completions fish) \
25 --zsh <($out/bin/git-absorb --gen-completions zsh)
26 '';
27
28 meta = with lib; {
29 homepage = "https://github.com/tummychow/git-absorb";
30 description = "git commit --fixup, but automatic";
31 license = [ licenses.bsd3 ];
32 maintainers = [ maintainers.marsam ];
33 };
34}