2020-10-29 20:53:41 +00:00
|
|
|
{ stdenv, lib, fetchurl, autoPatchelfHook, dpkg, awscli, unzip }:
|
|
|
|
let
|
|
|
|
ver = "1.2.7.0";
|
|
|
|
source = if stdenv.isDarwin then {
|
|
|
|
url =
|
|
|
|
"https://s3.amazonaws.com/session-manager-downloads/plugin/${ver}/mac/sessionmanager-bundle.zip";
|
|
|
|
sha256 = "sha256-HP+opNjS53zR9eUxpNUHGD9rZN1z7lDc6+nONR8fa/s=";
|
|
|
|
} else {
|
|
|
|
url =
|
|
|
|
"https://s3.amazonaws.com/session-manager-downloads/plugin/${ver}/ubuntu_64bit/session-manager-plugin.deb";
|
|
|
|
sha256 = "sha256-EZ9ncj1YYlod1RLfXOpZFijnKjLYWYVBb+C6yd42l34=";
|
|
|
|
};
|
|
|
|
platformBuildInput = if stdenv.isDarwin then [ unzip ] else [ dpkg ];
|
|
|
|
unpackCmd = if stdenv.isDarwin then "unzip $src" else "dpkg-deb -x $src .";
|
|
|
|
archivePath = if stdenv.isDarwin then "sessionmanager-bundle" else "usr/local/sessionmanagerplugin";
|
|
|
|
in
|
2020-05-07 06:13:47 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ssm-session-manager-plugin";
|
2020-10-29 20:53:41 +00:00
|
|
|
version = ver;
|
2020-05-07 06:13:47 +00:00
|
|
|
|
2020-10-29 20:53:41 +00:00
|
|
|
src = fetchurl source;
|
2020-05-07 06:13:47 +00:00
|
|
|
|
2020-10-29 20:53:41 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook ] ++ platformBuildInput;
|
2020-05-07 06:13:47 +00:00
|
|
|
|
|
|
|
buildInputs = [ awscli ];
|
|
|
|
|
2020-10-29 20:53:41 +00:00
|
|
|
unpackPhase = unpackCmd;
|
2020-05-07 06:13:47 +00:00
|
|
|
|
2020-10-29 20:53:41 +00:00
|
|
|
installPhase = "install -m755 -D ${archivePath}/bin/session-manager-plugin $out/bin/session-manager-plugin";
|
2020-05-07 06:13:47 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage =
|
|
|
|
"https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html";
|
|
|
|
description = "Amazon SSM Session Manager Plugin";
|
2020-10-29 20:53:41 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
2020-05-07 06:13:47 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ mbaillie ];
|
|
|
|
};
|
|
|
|
}
|