3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/opcr-policy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.3 KiB
Nix
Raw Normal View History

2022-10-04 17:34:18 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "opcr-policy";
2022-11-24 10:25:22 +00:00
version = "0.1.43";
2022-10-04 17:34:18 +01:00
src = fetchFromGitHub {
owner = "opcr-io";
repo = "policy";
rev = "v${version}";
2022-11-24 10:25:22 +00:00
sha256 = "sha256-6j3PEdSI8pLyTaYVUGmnPXV8P3arr3BukAI8R9eikCI=";
2022-10-04 17:34:18 +01:00
};
2022-11-24 10:25:22 +00:00
vendorSha256 = "sha256-wPtChLsIWX1YckA9p6YMxGMvqGqO0ohXYsOdkuCHbd4=";
2022-10-04 17:34:18 +01:00
ldflags = [ "-s" "-w" "-X github.com/opcr-io/policy/pkg/version.ver=${version}" ];
2022-11-24 10:25:22 +00:00
subPackages = [ "cmd/policy" ];
# disable go workspaces
GOWORK = "off";
2022-10-04 17:34:18 +01:00
doCheck = false;
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/policy --help
$out/bin/policy version | grep "version: ${version}"
runHook postInstallCheck
'';
meta = with lib; {
mainProgram = "policy";
homepage = "https://www.openpolicyregistry.io/";
changelog = "https://github.com/opcr-io/policy/releases/tag/v${version}";
description = "CLI for managing authorization policies";
longDescription = ''
The policy CLI is a tool for building, versioning and publishing your authorization policies.
It uses OCI standards to manage artifacts, and the Open Policy Agent (OPA) to compile and run.
'';
license = licenses.asl20;
maintainers = with maintainers; [ naphta jk ];
};
}