nixpkgs/pkgs/by-name/pi/pinact/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
973 B
Nix
Raw Normal View History

2023-10-16 10:09:32 +00:00
{ lib
, fetchFromGitHub
2024-02-14 14:45:15 +00:00
, buildGoModule
2023-10-16 10:09:32 +00:00
, testers
, pinact
}:
let
pname = "pinact";
2024-06-26 17:03:38 +00:00
version = "0.2.1";
2023-10-16 10:09:32 +00:00
src = fetchFromGitHub {
owner = "suzuki-shunsuke";
repo = "pinact";
rev = "v${version}";
2024-06-26 17:03:38 +00:00
hash = "sha256-HfeHfKXDBHPgxisWSVnrLOQf/4NXtnehkIjQqiCoFIc=";
2023-10-16 10:09:32 +00:00
};
in
2024-02-14 14:45:15 +00:00
buildGoModule {
2023-10-16 10:09:32 +00:00
inherit pname version src;
2024-06-26 17:03:38 +00:00
vendorHash = "sha256-L9EGygiJ40f7Yw46KdaAof5O/ren6inTK7XerB/uv1g=";
2023-10-16 10:09:32 +00:00
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";
};
}