2020-11-19 00:13:47 +00:00
|
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2020-11-19 00:13:47 +00:00
|
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
pname = "open-policy-agent";
|
2021-07-04 02:40:35 +00:00
|
|
|
|
version = "0.30.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "open-policy-agent";
|
|
|
|
|
repo = "opa";
|
|
|
|
|
rev = "v${version}";
|
2021-06-06 07:54:09 +00:00
|
|
|
|
sha256 = "sha256-AjNr+t30ftF92+cEfvt8iHBDVD/SO52ojJRLAkYF9l4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
2020-11-19 00:13:47 +00:00
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
2021-07-04 02:40:35 +00:00
|
|
|
|
ldflags = [ "-s" "-w" "-X github.com/open-policy-agent/opa/version.Version=${version}" ];
|
2021-03-12 07:09:13 +00:00
|
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
$out/bin/opa --help
|
|
|
|
|
$out/bin/opa version | grep "Version: ${version}"
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
|
'';
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
meta = with lib; {
|
2021-06-06 07:54:09 +00:00
|
|
|
|
homepage = "https://www.openpolicyagent.org";
|
|
|
|
|
changelog = "https://github.com/open-policy-agent/opa/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "General-purpose policy engine";
|
2020-11-19 00:13:47 +00:00
|
|
|
|
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 let’s 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.
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
license = licenses.asl20;
|
2021-03-12 07:09:13 +00:00
|
|
|
|
maintainers = with maintainers; [ lewo jk ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|