7 pname = "ssm-session-manager-plugin";
10 src = fetchFromGitHub {
12 repo = "session-manager-plugin";
14 hash = "sha256-bfj3LFUYgtrspFsLb46TuIOC3bj/WEamMUa47Q7kATI=";
18 # Add support for Go modules.
20 # This patch doesn't belong to any upstream PR, it is specially crafted for
21 # nixpkgs. Deleting the vendor dir is left out from the patch and done in
22 # postPatch instead, as otherwise the patch would be to big and GitHub returns
25 # With https://github.com/aws/session-manager-plugin/pull/74 there is an
26 # upstream PR with the same goal. It isn't pulled here as patch for the same
29 # Notice that the dependencies are pinned with the patch, and upstream dependency
30 # updates won't take effect. Patch should be recreated from time to time.
32 # - `go mod init github.com/aws/session-manager-plugin`
34 # - `go get github.com/twinj/uuid@v0.0.0-20151029044442-89173bcdda19`
36 # - `git checkout HEAD vendor`
37 ./0001-module-support.patch
44 vendorHash = "sha256-wK+aWRC5yrPtdihXAj6RlYC9ZTTPuGUg9wLY33skzeE=";
46 subPackages = [ "src/sessionmanagerplugin-main" ];
49 echo -n ${lib.escapeShellArg version} > VERSION
50 go run src/version/versiongenerator/version-gen.go
54 checkFlags = [ "-skip=TestSetSessionHandlers" ];
56 # The AWS CLI is expecting the binary name to be 'session-manager-plugin' and
57 # since the outfile is different the following workaround is renaming the binary.
59 mv $GOPATH/bin/sessionmanagerplugin-main $GOPATH/bin/${meta.mainProgram}
63 if ! [[ $($GOPATH/bin/${meta.mainProgram} --version) = ${lib.escapeShellArg version} ]]; then
70 homepage = "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html";
71 description = "Amazon SSM Session Manager Plugin";
72 mainProgram = "session-manager-plugin";
73 license = lib.licenses.asl20;
74 maintainers = with lib.maintainers; [ amarshall mbaillie ];