2020-10-29 20:53:41 +00:00
|
|
|
{ stdenv, lib, fetchurl, autoPatchelfHook, dpkg, awscli, unzip }:
|
|
|
|
let
|
2021-05-10 10:31:16 +01:00
|
|
|
ver = "1.2.54.0";
|
|
|
|
source =
|
|
|
|
if stdenv.isDarwin then {
|
|
|
|
url = "https://s3.amazonaws.com/session-manager-downloads/plugin/${ver}/mac/sessionmanager-bundle.zip";
|
|
|
|
sha256 = "kgxoQrtu2tsV5t/3oA+Z2juY24hPOznPGjlQMsqOIZg=";
|
|
|
|
} else {
|
|
|
|
url = "https://s3.amazonaws.com/session-manager-downloads/plugin/${ver}/ubuntu_64bit/session-manager-plugin.deb";
|
|
|
|
sha256 = "uug1cT4yRxNQcf+zWz0mi72G4EGa3eZHVuG36INSqrM=";
|
|
|
|
};
|
2020-10-29 20:53:41 +00:00
|
|
|
archivePath = if stdenv.isDarwin then "sessionmanager-bundle" else "usr/local/sessionmanagerplugin";
|
|
|
|
in
|
2020-05-07 07:13:47 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ssm-session-manager-plugin";
|
2020-10-29 20:53:41 +00:00
|
|
|
version = ver;
|
2020-05-07 07:13:47 +01:00
|
|
|
|
2020-10-29 20:53:41 +00:00
|
|
|
src = fetchurl source;
|
2020-05-07 07:13:47 +01:00
|
|
|
|
2021-05-10 10:31:16 +01:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook ] ++ (if stdenv.isDarwin then [ unzip ] else [ dpkg ]);
|
2020-05-07 07:13:47 +01:00
|
|
|
|
2021-05-10 10:31:16 +01:00
|
|
|
unpackPhase = if stdenv.isDarwin then "unzip $src" else "dpkg-deb -x $src .";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -m755 -D ${archivePath}/bin/session-manager-plugin $out/bin/session-manager-plugin
|
2020-05-07 07:13:47 +01:00
|
|
|
|
2021-05-10 10:31:16 +01:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-05-07 07:13:47 +01: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";
|
2021-11-16 17:24:39 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2020-05-07 07:13:47 +01:00
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ mbaillie ];
|
|
|
|
};
|
|
|
|
}
|