2022-07-14 12:49:19 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
2024-07-01 15:47:52 +00:00
|
|
|
, getent
|
2022-07-14 12:49:19 +00:00
|
|
|
, lib
|
|
|
|
, makeWrapper
|
2024-07-01 15:47:52 +00:00
|
|
|
, stdenv
|
2022-07-14 12:49:19 +00:00
|
|
|
, xdg-utils
|
|
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "aws-sso-cli";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.17.0";
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "synfinatic";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-VEI+vCNeNoFOE+2j/OUjRszXsUQP2E1iUdPUW9X3tHk=";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-a57RtK8PxwaRrSA6W6R//GacZ+pK8mBi4ZASS5NvShE=";
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X main.Version=${version}"
|
|
|
|
"-X main.Tag=nixpkgs"
|
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/aws-sso \
|
2022-08-21 13:32:41 +00:00
|
|
|
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
|
2022-07-14 12:49:19 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
nativeCheckInputs = [ getent ];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
checkFlags = let
|
|
|
|
skippedTests = [
|
|
|
|
"TestAWSConsoleUrl"
|
|
|
|
"TestAWSFederatedUrl"
|
|
|
|
"TestServerWithSSL" # https://github.com/synfinatic/aws-sso-cli/issues/1030 -- remove when version >= 2.x
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "TestDetectShellBash" ];
|
2024-09-19 14:19:46 +00:00
|
|
|
in
|
|
|
|
[ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/synfinatic/aws-sso-cli";
|
|
|
|
description = "AWS SSO CLI is a secure replacement for using the aws configure sso wizard";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ devusb ];
|
|
|
|
mainProgram = "aws-sso";
|
|
|
|
};
|
2022-06-26 10:26:21 +00:00
|
|
|
}
|