2024-09-19 14:19:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
AppKit,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "saml2aws";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.36.17";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Versent";
|
|
|
|
repo = "saml2aws";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
sha256 = "sha256-2bt/AUcXwXf1TxPesfXSyoiBeLHx+LGgDk4xbXEAcaY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-gtl8T8wXnpLgDZc6qSgFKpA+XbcLNHf20ieBkyNdE+s=";
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ AppKit ];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
subPackages = [
|
|
|
|
"."
|
|
|
|
"cmd/saml2aws"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X main.Version=${version}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
installShellCompletion --cmd saml2aws \
|
|
|
|
--bash <($out/bin/saml2aws --completion-script-bash) \
|
|
|
|
--zsh <($out/bin/saml2aws --completion-script-zsh)
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "saml2aws";
|
2024-09-19 14:19:46 +00:00
|
|
|
homepage = "https://github.com/Versent/saml2aws";
|
|
|
|
license = licenses.mit;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = [ lib.maintainers.pmyjavec ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|