nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 57 lines 1.7 kB view raw
1{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: 2 3buildGoModule rec { 4 pname = "conftest"; 5 version = "0.32.0"; 6 7 src = fetchFromGitHub { 8 owner = "open-policy-agent"; 9 repo = "conftest"; 10 rev = "v${version}"; 11 sha256 = "sha256-fPg3376QtbjrUJWZxjRqEFL2cWy1xb7vUX1Lfp5WFmY="; 12 }; 13 vendorSha256 = "sha256-/RfIjCI2RMktUSVEoyJqMwdmlW6lGvXanX7RBxiaTyE="; 14 15 ldflags = [ 16 "-s" 17 "-w" 18 "-X github.com/open-policy-agent/conftest/internal/commands.version=${version}" 19 ]; 20 21 nativeBuildInputs = [ installShellFiles ]; 22 23 preCheck = '' 24 export HOME="$TMPDIR" 25 ''; 26 27 postInstall = '' 28 installShellCompletion --cmd conftest \ 29 --bash <($out/bin/conftest completion bash) \ 30 --fish <($out/bin/conftest completion fish) \ 31 --zsh <($out/bin/conftest completion zsh) 32 ''; 33 34 doInstallCheck = true; 35 installCheckPhase = '' 36 export HOME="$TMPDIR" 37 $out/bin/conftest --version | grep ${version} > /dev/null 38 ''; 39 40 meta = with lib; { 41 description = "Write tests against structured configuration data"; 42 downloadPage = "https://github.com/open-policy-agent/conftest"; 43 homepage = "https://www.conftest.dev"; 44 license = licenses.asl20; 45 longDescription = '' 46 Conftest helps you write tests against structured configuration data. 47 Using Conftest you can write tests for your Kubernetes configuration, 48 Tekton pipeline definitions, Terraform code, Serverless configs or any 49 other config files. 50 51 Conftest uses the Rego language from Open Policy Agent for writing the 52 assertions. You can read more about Rego in 'How do I write policies' in 53 the Open Policy Agent documentation. 54 ''; 55 maintainers = with maintainers; [ jk yurrriq ]; 56 }; 57}