nixpkgs/pkgs/by-name/pi/pinact/package.nix
2024-11-06 19:50:04 +09:00

46 lines
973 B
Nix

{ lib
, fetchFromGitHub
, buildGoModule
, testers
, pinact
}:
let
pname = "pinact";
version = "1.0.0";
src = fetchFromGitHub {
owner = "suzuki-shunsuke";
repo = "pinact";
rev = "v${version}";
hash = "sha256-fOmQDfqG1aWzpL80Nc8JA6HWQR+z9mhqtwU4rC2g2Gg=";
};
in
buildGoModule {
inherit pname version src;
vendorHash = "sha256-AFlkzs5mL/x9CwfF2apLcQbiu60GD33oFH6lQDHAL1M=";
doCheck = true;
passthru.tests.version = testers.testVersion {
package = pinact;
command = "pinact --version";
version = src.rev;
};
ldflags = [
"-s"
"-w"
"-X main.version=${version} -X main.commit=${src.rev}"
];
meta = with lib; {
description = "Pin GitHub Actions versions";
homepage = "https://github.com/suzuki-shunsuke/pinact";
changelog = "https://github.com/suzuki-shunsuke/pinact/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = [ maintainers.kachick ];
mainProgram = "pinact";
};
}