My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/development/tools/konstraint/default.nix

49 lines
1.7 KiB

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "konstraint";
version = "0.19.1";
src = fetchFromGitHub {
owner = "plexsystems";
repo = pname;
rev = "v${version}";
sha256 = "sha256-MQ9Rb8U1CGbEgNtkOdK879dr8uOro6CAl4wGMbuT+wo=";
};
vendorSha256 = "sha256-gUuceNwOI+ss2YDiIF+zxyOj53iV6kGtVhNCd5KQomo=";
# Exclude go within .github folder
excludedPackages = ".github";
nativeBuildInputs = [ installShellFiles ];
ldflags = [ "-s" "-w" "-X github.com/plexsystems/konstraint/internal/commands.version=${version}" ];
postInstall = ''
installShellCompletion --cmd konstraint \
--bash <($out/bin/konstraint completion bash) \
--fish <($out/bin/konstraint completion fish) \
--zsh <($out/bin/konstraint completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/konstraint --help
$out/bin/konstraint --version | grep "${version}"
runHook postInstallCheck
'';
meta = with lib; {
homepage = "https://github.com/plexsystems/konstraint";
changelog = "https://github.com/plexsystems/konstraint/releases/tag/v${version}";
description = "A policy management tool for interacting with Gatekeeper";
longDescription = ''
konstraint is a CLI tool to assist with the creation and management of templates and constraints when using
Gatekeeper. Automatically copy Rego to the ConstraintTemplate. Automatically update all ConstraintTemplates with
library changes. Enable writing the same policies for Conftest and Gatekeeper.
'';
license = licenses.mit;
maintainers = with maintainers; [ jk ];
};
}