1 { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
7 src = fetchFromGitHub {
11 sha256 = "sha256-PSJNPN5hd5Tgt6F70II2gMiUiU0irncSefm6Q7WjUDE=";
13 vendorHash = "sha256-0zWTVE82GaSyWfgbRASpNdO/d4kKOts1XdPspmgfpV8=";
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";
42 konstraint is a CLI tool to assist with the creation and management of templates and constraints when using
43 Gatekeeper. Automatically copy Rego to the ConstraintTemplate. Automatically update all ConstraintTemplates with
44 library changes. Enable writing the same policies for Conftest and Gatekeeper.
46 license = licenses.mit;
47 maintainers = with maintainers; [ jk ];