depot/third_party/nixpkgs/pkgs/development/tools/open-policy-agent/default.nix
Default email 14e964f59b Project import generated by Copybara.
GitOrigin-RevId: fbfb79400a08bf754e32b4d4fc3f7d8f8055cf94
2021-06-06 04:54:09 -03:00

43 lines
1.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "open-policy-agent";
version = "0.29.4";
src = fetchFromGitHub {
owner = "open-policy-agent";
repo = "opa";
rev = "v${version}";
sha256 = "sha256-AjNr+t30ftF92+cEfvt8iHBDVD/SO52ojJRLAkYF9l4=";
};
vendorSha256 = null;
subPackages = [ "." ];
preBuild = ''
buildFlagsArray+=("-ldflags" "-s -w -X github.com/open-policy-agent/opa/version.Version=${version}")
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/opa --help
$out/bin/opa version | grep "Version: ${version}"
runHook postInstallCheck
'';
meta = with lib; {
homepage = "https://www.openpolicyagent.org";
changelog = "https://github.com/open-policy-agent/opa/blob/v${version}/CHANGELOG.md";
description = "General-purpose policy engine";
longDescription = ''
The Open Policy Agent (OPA, pronounced "oh-pa") is an open source, general-purpose policy engine that unifies
policy enforcement across the stack. OPA provides a high-level declarative language that lets you specify policy
as code and simple APIs to offload policy decision-making from your software. You can use OPA to enforce policies
in microservices, Kubernetes, CI/CD pipelines, API gateways, and more.
'';
license = licenses.asl20;
maintainers = with maintainers; [ lewo jk ];
};
}