2025-07-29 10:27:34 +10:00

57 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
nixosTests,
stdenv,
testers,
telegraf,
}:
buildGoModule rec {
pname = "telegraf";
version = "1.35.3";
subPackages = [ "cmd/telegraf" ];
src = fetchFromGitHub {
owner = "influxdata";
repo = "telegraf";
rev = "v${version}";
hash = "sha256-EwO7dvPJkLCxO9xZCW7gX57tCO7RIpJ23vqwOkMOVnw=";
};
vendorHash = "sha256-DHtgN8yf+4YYrDJKnFasICScYqq65iPGi7pFoxQawv8=";
proxyVendor = true;
ldflags = [
"-s"
"-w"
"-X=github.com/influxdata/telegraf/internal.Commit=${src.rev}"
"-X=github.com/influxdata/telegraf/internal.Version=${version}"
];
passthru.tests = {
version = testers.testVersion {
package = telegraf;
};
}
// lib.optionalAttrs stdenv.hostPlatform.isLinux {
inherit (nixosTests) telegraf;
};
meta = with lib; {
description = "Plugin-driven server agent for collecting & reporting metrics";
mainProgram = "telegraf";
homepage = "https://www.influxdata.com/time-series-platform/telegraf/";
changelog = "https://github.com/influxdata/telegraf/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [
mic92
roblabla
timstott
zowoq
];
};
}