depot/third_party/nixpkgs/pkgs/tools/security/cliam/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

48 lines
1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "cliam";
version = "2.0.0";
src = fetchFromGitHub {
owner = "securisec";
repo = pname;
rev = version;
hash = "sha256-TEpAY1yY5AFTg5yUZMvTFdZiQ7yBi0rjYgCCksiMfDU=";
};
vendorSha256 = "sha256-VCai9rxpnlpviN5W/VIRcNGvPljE2gbFnxA1OKhVElk=";
nativeBuildInputs = [
installShellFiles
];
ldflags = [
"-s"
"-w"
"-X github.com/securisec/cliam/cli/version.Version=${version}"
];
postBuild = ''
# should be called cliam
mv $GOPATH/bin/{cli,cliam}
'';
postInstall = ''
installShellCompletion --cmd cliam \
--bash <($out/bin/cliam completion bash) \
--fish <($out/bin/cliam completion fish) \
--zsh <($out/bin/cliam completion zsh)
'';
meta = with lib; {
description = "Cloud agnostic IAM permissions enumerator";
homepage = "https://github.com/securisec/cliam";
license = licenses.gpl3Only;
maintainers = with maintainers; [ fab ];
};
}