2021-05-03 20:48:10 +00:00
|
|
|
{ buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, makeWrapper
|
2024-02-29 20:09:43 +00:00
|
|
|
, stdenv
|
2021-05-03 20:48:10 +00:00
|
|
|
, xdg-utils
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "aws-vault";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "7.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "99designs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
sha256 = "sha256-Qs4vxFgehWQYYECBGBSU8YI/BHLwOQUO5wBlNEUzD7c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
vendorHash = "sha256-4bJKDEZlO0DzEzTQ7m+SQuzhe+wKmL6wLueqgSz/46s=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2022-08-21 13:32:41 +00:00
|
|
|
# make xdg-open overrideable at runtime
|
2024-02-29 20:09:43 +00:00
|
|
|
# aws-vault uses https://github.com/skratchdot/open-golang/blob/master/open/open.go to open links
|
|
|
|
${lib.optionalString (!stdenv.isDarwin) "wrapProgram $out/bin/aws-vault --suffix PATH : ${lib.makeBinPath [ xdg-utils ]}"}
|
2021-03-09 03:18:52 +00:00
|
|
|
installShellCompletion --cmd aws-vault \
|
|
|
|
--bash $src/contrib/completions/bash/aws-vault.bash \
|
|
|
|
--fish $src/contrib/completions/fish/aws-vault.fish \
|
|
|
|
--zsh $src/contrib/completions/zsh/aws-vault.zsh
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
# set the version. see: aws-vault's Makefile
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X main.Version=v${version}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/aws-vault --version 2>&1 | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description =
|
|
|
|
"A vault for securely storing and accessing AWS credentials in development environments";
|
|
|
|
homepage = "https://github.com/99designs/aws-vault";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zimbatm ];
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|