diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9e745df9a4d3..69726dc8977e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3655,6 +3655,12 @@ github = "bmwalters"; githubId = 4380777; }; + bnjmnt4n = { + name = "Benjamin Tan"; + github = "bnjmnt4n"; + githubId = 813865; + email = "benjamin@dev.ofcr.se"; + }; bnlrnz = { github = "bnlrnz"; githubId = 11310385; diff --git a/pkgs/by-name/gi/git-pkgs/package.nix b/pkgs/by-name/gi/git-pkgs/package.nix new file mode 100644 index 000000000000..5b67fe053d4c --- /dev/null +++ b/pkgs/by-name/gi/git-pkgs/package.nix @@ -0,0 +1,52 @@ +{ + lib, + stdenv, + fetchFromGitHub, + buildGoModule, + installShellFiles, +}: +buildGoModule rec { + pname = "git-pkgs"; + version = "0.11.0"; + + src = fetchFromGitHub { + owner = "git-pkgs"; + repo = "git-pkgs"; + tag = "v${version}"; + hash = "sha256-XjW3qwybTmzW2CNgu1Edgs5ZZ9xl3+uS4sT8VWD3jyQ="; + }; + + vendorHash = "sha256-/LJwq17f7SAjSV2ZcLrdaKZYf9RVJ9wtYqEsW0ubT1Q="; + + subPackages = [ "." ]; + + ldflags = [ + "-X github.com/git-pkgs/git-pkgs/cmd.version=${version}" + ]; + + # Tries to access the internet. + doCheck = false; + + nativeBuildInputs = [ installShellFiles ]; + + postBuild = '' + go run scripts/generate-man.go + installManPage man/*.1 + ''; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd git-pkgs \ + --bash <($out/bin/git-pkgs completion bash) \ + --fish <($out/bin/git-pkgs completion fish) \ + --zsh <($out/bin/git-pkgs completion zsh) + ''; + + meta = { + homepage = "https://github.com/git-pkgs/git-pkgs"; + description = "Git subcommand for analyzing package/dependency usage in git repositories over time"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bnjmnt4n ]; + platforms = lib.platforms.unix; + mainProgram = "git-pkgs"; + }; +}