10 src = fetchFromGitHub {
14 sha256 = "sha256-3rMSk4oRqPWqJh4o+oGtfqpEz4zkr4CVaIyMvBopN/o=";
16 vendorHash = "sha256-ZP4EM7NZwfTLx0e47DikgMI7Y+IYmREdLL/r/CC9P7c=";
18 ldflags = [ "-s" "-w" "-X github.com/opcr-io/policy/pkg/version.ver=${version}" ];
20 subPackages = [ "cmd/policy" ];
21 # disable go workspaces
26 doInstallCheck = true;
27 installCheckPhase = ''
28 runHook preInstallCheck
30 $out/bin/policy --help
31 $out/bin/policy version | grep "version: ${version}"
33 runHook postInstallCheck
37 mainProgram = "policy";
38 homepage = "https://www.openpolicyregistry.io/";
39 changelog = "https://github.com/opcr-io/policy/releases/tag/v${version}";
40 description = "CLI for managing authorization policies";
42 The policy CLI is a tool for building, versioning and publishing your authorization policies.
43 It uses OCI standards to manage artifacts, and the Open Policy Agent (OPA) to compile and run.
45 license = licenses.asl20;
46 maintainers = with maintainers; [ naphta jk ];