From 305ad04a9e9bf8932f20de1e27d6c369ed97ef7f Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 28 Sep 2023 14:13:35 +0200 Subject: [PATCH 1/6] ssm-agent: 3.2.1478.0 -> 3.2.1630.0 https://github.com/aws/amazon-ssm-agent/compare/3.2.1478.0...3.2.1630.0 https://github.com/aws/amazon-ssm-agent/releases/tag/3.2.1630.0 https://github.com/aws/amazon-ssm-agent/releases/tag/3.2.1542.0 --- .../applications/networking/cluster/ssm-agent/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index a073c9b6fd84..08996bf84d40 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -27,17 +27,17 @@ let in buildGoPackage rec { pname = "amazon-ssm-agent"; - version = "3.2.1478.0"; + version = "3.2.1630.0"; goPackagePath = "github.com/aws/${pname}"; nativeBuildInputs = [ makeWrapper ]; src = fetchFromGitHub { - rev = version; + rev = "refs/tags/${version}"; owner = "aws"; repo = "amazon-ssm-agent"; - hash = "sha256-SS0N3Wcksk2vq52K6GYE9z4hrckXGqiuCuYPHkH4SWc="; + hash = "sha256-0tN0rBfz2VZ4UkYLFDGg9218O9vyyRT2Lrppu9TETao="; }; patches = [ @@ -49,7 +49,7 @@ buildGoPackage rec { ./0002-version-gen-don-t-use-unnecessary-constants.patch ]; - # See the list https://github.com/aws/amazon-ssm-agent/blob/3.2.1478.0/makefile#L120-L138 + # See the list https://github.com/aws/amazon-ssm-agent/blob/3.2.1630.0/makefile#L120-L138 # The updater is not built because it cannot work on NixOS subPackages = [ "core" From bf08e5603218b7cf94113068824a3f95bc24d340 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 28 Sep 2023 14:26:57 +0200 Subject: [PATCH 2/6] ssm-agent: add passthru.tests.version --- pkgs/applications/networking/cluster/ssm-agent/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index 08996bf84d40..888693d82ab6 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -9,6 +9,8 @@ , util-linux , bashInteractive , overrideEtc ? true +, testers +, ssm-agent }: let @@ -129,6 +131,11 @@ buildGoPackage rec { wrapProgram $out/bin/amazon-ssm-agent --prefix PATH : ${bashInteractive}/bin ''; + passthru.tests.version = testers.testVersion { + package = ssm-agent; + command = "amazon-ssm-agent --version"; + }; + meta = with lib; { description = "Agent to enable remote management of your Amazon EC2 instance configuration"; homepage = "https://github.com/aws/amazon-ssm-agent"; From 0f36289db9ef3791bfc06ee15149c0cdfcb86713 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 28 Sep 2023 14:27:30 +0200 Subject: [PATCH 3/6] ssm-agent: add meta.changelog --- pkgs/applications/networking/cluster/ssm-agent/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index 888693d82ab6..6327ac37f9ff 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -138,6 +138,7 @@ buildGoPackage rec { meta = with lib; { description = "Agent to enable remote management of your Amazon EC2 instance configuration"; + changelog = "https://github.com/aws/amazon-ssm-agent/releases/tag/${version}"; homepage = "https://github.com/aws/amazon-ssm-agent"; license = licenses.asl20; platforms = platforms.unix; From 53499f6c2177c122f69465d6af94e91bdd568f29 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 28 Sep 2023 14:27:51 +0200 Subject: [PATCH 4/6] ssm-agent: add anthonyroussel to maintainers --- pkgs/applications/networking/cluster/ssm-agent/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index 6327ac37f9ff..ea017fa24b74 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -142,6 +142,6 @@ buildGoPackage rec { homepage = "https://github.com/aws/amazon-ssm-agent"; license = licenses.asl20; platforms = platforms.unix; - maintainers = with maintainers; [ copumpkin manveru ]; + maintainers = with maintainers; [ copumpkin manveru anthonyroussel ]; }; } From 62c2d2b52fea9b40b2b2cdb7ff56b5783ea45da0 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 28 Sep 2023 14:29:05 +0200 Subject: [PATCH 5/6] ssm-agent: add passthru.updateScript --- .../networking/cluster/ssm-agent/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index ea017fa24b74..c27447d6631d 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -8,9 +8,10 @@ , dmidecode , util-linux , bashInteractive -, overrideEtc ? true +, nix-update-script , testers , ssm-agent +, overrideEtc ? true }: let @@ -131,9 +132,12 @@ buildGoPackage rec { wrapProgram $out/bin/amazon-ssm-agent --prefix PATH : ${bashInteractive}/bin ''; - passthru.tests.version = testers.testVersion { - package = ssm-agent; - command = "amazon-ssm-agent --version"; + passthru = { + updateScript = nix-update-script { }; + tests.version = testers.testVersion { + package = ssm-agent; + command = "amazon-ssm-agent --version"; + }; }; meta = with lib; { From 4c55c3c8b953cfe7ffdfef27254e34e21a18791b Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Thu, 28 Sep 2023 14:46:33 +0200 Subject: [PATCH 6/6] ssm-agent: mark darwin support as broken --- .../networking/cluster/ssm-agent/default.nix | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/cluster/ssm-agent/default.nix b/pkgs/applications/networking/cluster/ssm-agent/default.nix index c27447d6631d..613bac4c9ea6 100644 --- a/pkgs/applications/networking/cluster/ssm-agent/default.nix +++ b/pkgs/applications/networking/cluster/ssm-agent/default.nix @@ -5,8 +5,10 @@ , fetchFromGitHub , coreutils , nettools -, dmidecode +, busybox , util-linux +, stdenv +, dmidecode , bashInteractive , nix-update-script , testers @@ -68,24 +70,27 @@ buildGoPackage rec { "-w" ]; - preConfigure = '' + postPatch = '' printf "#!/bin/sh\ntrue" > ./Tools/src/checkstyle.sh substituteInPlace agent/platform/platform_unix.go \ - --replace "/usr/bin/uname" "${coreutils}/bin/uname" \ - --replace '"/bin", "hostname"' '"${nettools}/bin/hostname"' \ - --replace '"lsb_release"' '"${fake-lsb-release}/bin/lsb_release"' - - substituteInPlace agent/managedInstances/fingerprint/hardwareInfo_unix.go \ - --replace /usr/sbin/dmidecode ${dmidecode}/bin/dmidecode + --replace "/usr/bin/uname" "${coreutils}/bin/uname" \ + --replace '"/bin", "hostname"' '"${nettools}/bin/hostname"' \ + --replace '"lsb_release"' '"${fake-lsb-release}/bin/lsb_release"' substituteInPlace agent/session/shell/shell_unix.go \ - --replace '"script"' '"${util-linux}/bin/script"' + --replace '"script"' '"${util-linux}/bin/script"' + + substituteInPlace agent/rebooter/rebooter_unix.go \ + --replace "/sbin/shutdown" "shutdown" echo "${version}" > VERSION '' + lib.optionalString overrideEtc '' substituteInPlace agent/appconfig/constants_unix.go \ --replace '"/etc/amazon/ssm/"' '"${placeholder "out"}/etc/amazon/ssm/"' + '' + lib.optionalString stdenv.isLinux '' + substituteInPlace agent/managedInstances/fingerprint/hardwareInfo_unix.go \ + --replace /usr/sbin/dmidecode ${dmidecode}/bin/dmidecode ''; preBuild = '' @@ -147,5 +152,8 @@ buildGoPackage rec { license = licenses.asl20; platforms = platforms.unix; maintainers = with maintainers; [ copumpkin manveru anthonyroussel ]; + + # Darwin support is broken + broken = stdenv.isDarwin; }; }