Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / tools / turbogit / default.nix
blob2680d10f1dbb856b769c8e2073c0c24d73070661
1 { fetchFromGitHub, buildGoModule, lib, installShellFiles, libgit2, pkg-config }:
2 buildGoModule rec {
3   pname = "turbogit";
4   version = "3.1.1";
6   src = fetchFromGitHub {
7     owner = "b4nst";
8     repo = pname;
9     rev = "v${version}";
10     sha256 = "sha256-BHgVJlitRUX/9zYPoK5XfRpzzTZRbLhQVZJcx8KVshk=";
11   };
13   vendorHash = "sha256-280OcGXZQJD4G6z0b2WnWAS+v7XVptyf2WnlPjG99/0=";
15   subPackages = [ "." ];
17   buildInputs = [ libgit2 ];
18   nativeBuildInputs = [ installShellFiles pkg-config ];
19   postInstall = ''
20     # Move turbogit binary to tug
21     ln -s $out/bin/turbogit $out/bin/tug
23     # Generate completion files
24     mkdir -p share/completions
25     $out/bin/tug completion bash > share/completions/tug.bash
26     $out/bin/tug completion fish > share/completions/tug.fish
27     $out/bin/tug completion zsh > share/completions/tug.zsh
29     installShellCompletion share/completions/tug.{bash,fish,zsh}
30   '';
32   meta = with lib; {
33     description = "Keep your git workflow clean without headache.";
34     longDescription = ''
35       turbogit (tug) is a cli tool built to help you deal with your day-to-day git work.
36       turbogit enforces convention (e.g. The Conventional Commits) but tries to keep things simple and invisible for you.
37       turbogit is your friend.
38     '';
39     homepage = "https://b4nst.github.io/turbogit";
40     license = licenses.mit;
41     platforms = platforms.linux ++ platforms.darwin;
42     maintainers = [ maintainers.yusdacra ];
43   };