nixpkgs/pkgs/development/tools/api-linter/default.nix
2024-01-23 07:50:24 +00:00

42 lines
975 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "api-linter";
version = "1.63.2";
src = fetchFromGitHub {
owner = "googleapis";
repo = "api-linter";
rev = "v${version}";
hash = "sha256-xbYu/5E3rkH5VUuH0fCs2gfpWysDVABxY+pA4JkU5WY=";
};
vendorHash = "sha256-SDfErsM9wC1bGgBwcMRvjTOzqGNQ3kIQM7XeL4sLTC8=";
subPackages = [ "cmd/api-linter" ];
ldflags = [
"-s"
"-w"
];
# reference: https://github.com/googleapis/api-linter/blob/v1.63.2/.github/workflows/release.yaml#L76
preBuild = ''
cat > cmd/api-linter/version.go <<EOF
package main
const version = "${version}"
EOF
'';
meta = with lib; {
description = "Linter for APIs defined in protocol buffers";
homepage = "https://github.com/googleapis/api-linter/";
changelog = "https://github.com/googleapis/api-linter/releases/tag/${src.rev}";
license = licenses.asl20;
maintainers = with maintainers; [ xrelkd ];
};
}