Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

66 lines
1.8 KiB
Nix

{
lib,
amazon-cloudwatch-agent,
buildGoModule,
fetchFromGitHub,
nix-update-script,
nixosTests,
stdenv,
versionCheckHook,
}:
buildGoModule rec {
pname = "amazon-cloudwatch-agent";
version = "1.300059.0";
src = fetchFromGitHub {
owner = "aws";
repo = "amazon-cloudwatch-agent";
tag = "v${version}";
hash = "sha256-xon1M3xusoFngeZ2CJprS1z4fcrWeKCKaAtAfv4SBWw=";
};
vendorHash = "sha256-79BaMjl1bzQcl3FUvpwRsPneQRyfabU481eLgWA1U6Y=";
# See the list in https://github.com/aws/amazon-cloudwatch-agent/blob/v1.300049.1/Makefile#L68-L77.
subPackages = [
"cmd/config-downloader"
"cmd/config-translator"
"cmd/amazon-cloudwatch-agent"
# Broken since it hardcodes the package install path. See https://github.com/aws/amazon-cloudwatch-agent/issues/1319.
# "cmd/start-amazon-cloudwatch-agent"
"cmd/amazon-cloudwatch-agent-config-wizard"
];
# See https://github.com/aws/amazon-cloudwatch-agent/blob/v1.300049.1/Makefile#L57-L64.
#
# Needed for "amazon-cloudwatch-agent -version" to not show "Unknown".
postInstall = ''
echo v${version} > $out/bin/CWAGENT_VERSION
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/amazon-cloudwatch-agent";
versionCheckProgramArg = "-version";
passthru = {
tests = lib.optionalAttrs stdenv.hostPlatform.isLinux {
inherit (nixosTests) amazon-cloudwatch-agent;
};
updateScript = nix-update-script { };
};
meta = {
description = "CloudWatch Agent enables you to collect and export host-level metrics and logs on instances running Linux or Windows server";
homepage = "https://github.com/aws/amazon-cloudwatch-agent";
license = lib.licenses.mit;
mainProgram = "amazon-cloudwatch-agent";
maintainers = with lib.maintainers; [ pmw ];
};
}