nixpkgs/pkgs/tools/admin/berglas/default.nix

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

50 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub }:
2019-09-30 14:01:27 +02:00
let
skipTests = {
access = "Access";
create = "Create";
delete = "Delete";
list = "List";
read = "Read";
replace = "Replace";
resolver = "Resolve";
revoke = "Revoke";
update = "Update";
};
skipTestsCommand =
builtins.foldl' (acc: goFileName:
let testName = builtins.getAttr goFileName skipTests; in
''
${acc}
substituteInPlace pkg/berglas/${goFileName}_test.go \
--replace "TestClient_${testName}_storage" "SkipClient_${testName}_storage" \
--replace "TestClient_${testName}_secretManager" "SkipClient_${testName}_secretManager"
''
) "" (builtins.attrNames skipTests);
in
2019-09-30 14:01:27 +02:00
buildGoModule rec {
2020-03-14 16:54:07 +01:00
pname = "berglas";
2022-08-18 10:02:34 +02:00
version = "1.0.1";
2019-09-30 14:01:27 +02:00
src = fetchFromGitHub {
owner = "GoogleCloudPlatform";
2020-03-14 16:54:07 +01:00
repo = pname;
rev = "v${version}";
2022-08-18 10:02:34 +02:00
sha256 = "sha256-A4TUVNsiWODH8jJzV4AYchIQjDWXysJbFPYQ5W63T08=";
2019-09-30 14:01:27 +02:00
};
2022-08-18 10:02:34 +02:00
vendorSha256 = "sha256-jJuwfP0zJ70r62IFTPsXBCAEKDcuBwHsBR24jGx/IqY=";
2019-09-30 14:01:27 +02:00
postPatch = skipTestsCommand;
meta = with lib; {
2019-09-30 14:01:27 +02:00
description = "A tool for managing secrets on Google Cloud";
2020-03-14 16:54:07 +01:00
homepage = "https://github.com/GoogleCloudPlatform/berglas";
2019-09-30 14:01:27 +02:00
license = licenses.asl20;
platforms = platforms.unix;
};
}