2025-08-15 05:50:45 +00:00

52 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
installShellFiles,
nix-update-script,
rustPlatform,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "zizmor";
version = "1.12.1";
src = fetchFromGitHub {
owner = "zizmorcore";
repo = "zizmor";
tag = "v${finalAttrs.version}";
hash = "sha256-GnKSbcsVYzbhsrwIUAEArltzQe0IE2tiIr2CqsMQyzk=";
};
cargoHash = "sha256-wLJlaV59sAo97KI6Ekw42aaG6hVkul1wFvcC+71+Zp4=";
nativeBuildInputs = lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
installShellFiles
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd zizmor \
--bash <("$out/bin/zizmor" --completions bash) \
--zsh <("$out/bin/zizmor" --completions zsh) \
--fish <("$out/bin/zizmor" --completions fish)
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex=^v([0-9.]+\.[0-9.]+\.[0-9.])+$" ];
};
meta = {
description = "Tool for finding security issues in GitHub Actions setups";
homepage = "https://docs.zizmor.sh/";
changelog = "https://github.com/zizmorcore/zizmor/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ lesuisse ];
mainProgram = "zizmor";
};
})