Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
76 lines
1.7 KiB
Nix
76 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
buildGoModule,
|
|
installShellFiles,
|
|
versionCheckHook,
|
|
nix-update-script,
|
|
}:
|
|
|
|
let
|
|
mainProgram = "pinact";
|
|
in
|
|
buildGoModule (finalAttrs: {
|
|
pname = "pinact";
|
|
version = "3.4.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "suzuki-shunsuke";
|
|
repo = "pinact";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-O+yLhvkF84uCrgb5MPvk8i/YJ4tLR7YQvBAYbpnxwEM=";
|
|
};
|
|
|
|
vendorHash = "sha256-A9bMAGaNvCKfSozBwhrJLgQUrCLN78Og3eCmezsJ6c8=";
|
|
|
|
env.CGO_ENABLED = 0;
|
|
|
|
doCheck = true;
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd '${mainProgram}' \
|
|
--bash <("$out/bin/${mainProgram}" completion bash) \
|
|
--zsh <("$out/bin/${mainProgram}" completion zsh) \
|
|
--fish <("$out/bin/${mainProgram}" completion fish)
|
|
'';
|
|
|
|
nativeInstallCheckInputs = [
|
|
versionCheckHook
|
|
];
|
|
doInstallCheck = true;
|
|
versionCheckProgram = "${placeholder "out"}/bin/${mainProgram}";
|
|
versionCheckProgramArg = "version";
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script {
|
|
extraArgs = [
|
|
"--version-regex=^v([\\d\\.]+)$"
|
|
];
|
|
};
|
|
};
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.version=${finalAttrs.version} -X main.commit=v${finalAttrs.version}"
|
|
];
|
|
|
|
subPackages = [
|
|
"cmd/pinact"
|
|
];
|
|
|
|
meta = {
|
|
inherit mainProgram;
|
|
description = "Pin GitHub Actions versions";
|
|
homepage = "https://github.com/suzuki-shunsuke/pinact";
|
|
changelog = "https://github.com/suzuki-shunsuke/pinact/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ kachick ];
|
|
};
|
|
})
|