1 { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
7 src = fetchFromGitHub {
11 sha256 = "sha256-GQ79xsvlRDwrthtYgykwAJLP9rkk5iNHGelWAQzOZoA=";
13 vendorHash = "sha256-EBlJCcF8UcstaD1ztaAFL4MSfBOYvpeUygzXnQbW8N8=";
15 # Exclude go within .github folder
16 excludedPackages = ".github";
18 nativeBuildInputs = [ installShellFiles ];
20 ldflags = [ "-s" "-w" "-X github.com/plexsystems/konstraint/internal/commands.version=${version}" ];
23 installShellCompletion --cmd konstraint \
24 --bash <($out/bin/konstraint completion bash) \
25 --fish <($out/bin/konstraint completion fish) \
26 --zsh <($out/bin/konstraint completion zsh)
29 doInstallCheck = true;
30 installCheckPhase = ''
31 runHook preInstallCheck
32 $out/bin/konstraint --help
33 $out/bin/konstraint --version | grep "${version}"
34 runHook postInstallCheck
38 homepage = "https://github.com/plexsystems/konstraint";
39 changelog = "https://github.com/plexsystems/konstraint/releases/tag/v${version}";
40 description = "A policy management tool for interacting with Gatekeeper";
41 mainProgram = "konstraint";
43 konstraint is a CLI tool to assist with the creation and management of templates and constraints when using
44 Gatekeeper. Automatically copy Rego to the ConstraintTemplate. Automatically update all ConstraintTemplates with
45 library changes. Enable writing the same policies for Conftest and Gatekeeper.
47 license = licenses.mit;
48 maintainers = with maintainers; [ jk ];