depot/third_party/nixpkgs/pkgs/development/tools/conftest/default.nix
Default email 88abffb7d2 Project import generated by Copybara.
GitOrigin-RevId: bc9b956714ed6eac5f8888322aac5bc41389defa
2021-09-18 12:52:07 +02:00

46 lines
1.4 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "conftest";
version = "0.27.0";
src = fetchFromGitHub {
owner = "open-policy-agent";
repo = "conftest";
rev = "v${version}";
sha256 = "sha256-Yc/aejGLMbAqpIRTVQQ3lv7/oyr7tVAy41Gx6198Eos=";
};
vendorSha256 = "sha256-jI5bX6S2C0ckiiieVlaRNEsLS/5gGkC3o/xauDtCOjA=";
ldflags = [
"-s"
"-w"
"-X github.com/open-policy-agent/conftest/internal/commands.version=${version}"
];
HOME = "$TMPDIR";
doInstallCheck = true;
installCheckPhase = ''
$out/bin/conftest --version | grep ${version} > /dev/null
'';
meta = with lib; {
description = "Write tests against structured configuration data";
downloadPage = "https://github.com/open-policy-agent/conftest";
homepage = "https://www.conftest.dev";
license = licenses.asl20;
longDescription = ''
Conftest helps you write tests against structured configuration data.
Using Conftest you can write tests for your Kubernetes configuration,
Tekton pipeline definitions, Terraform code, Serverless configs or any
other config files.
Conftest uses the Rego language from Open Policy Agent for writing the
assertions. You can read more about Rego in 'How do I write policies' in
the Open Policy Agent documentation.
'';
maintainers = with maintainers; [ jk superherointj yurrriq ];
};
}