Skip to content

Commit

Permalink
saml2aws: install shell completion (NixOS#339219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksanaa authored Sep 6, 2024
2 parents 671844d + b2654f9 commit a870a6e
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions pkgs/tools/security/saml2aws/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub, AppKit }:
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
AppKit,
}:

buildGoModule rec {
pname = "saml2aws";
Expand All @@ -13,19 +20,29 @@ buildGoModule rec {

vendorHash = "sha256-gtl8T8wXnpLgDZc6qSgFKpA+XbcLNHf20ieBkyNdE+s=";

nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ AppKit ];

subPackages = [ "." "cmd/saml2aws" ];
subPackages = [
"."
"cmd/saml2aws"
];

ldflags = [
"-X main.Version=${version}"
];

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)
'';

meta = with lib; {
description = "CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP";
mainProgram = "saml2aws";
homepage = "https://github.com/Versent/saml2aws";
license = licenses.mit;
homepage = "https://github.com/Versent/saml2aws";
license = licenses.mit;
maintainers = [ lib.maintainers.pmyjavec ];
};
}

0 comments on commit a870a6e

Please sign in to comment.