From a0215e28ead5f41cd758f187e2a37a33ac016d63 Mon Sep 17 00:00:00 2001 From: figsoda Date: Sun, 28 May 2023 10:14:26 -0400 Subject: [PATCH 1/2] telegraf: fix version --- pkgs/servers/monitoring/telegraf/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/monitoring/telegraf/default.nix b/pkgs/servers/monitoring/telegraf/default.nix index f800bb842904..3ae88c9990b0 100644 --- a/pkgs/servers/monitoring/telegraf/default.nix +++ b/pkgs/servers/monitoring/telegraf/default.nix @@ -19,7 +19,10 @@ buildGoModule rec { proxyVendor = true; ldflags = [ - "-w" "-s" "-X main.version=${version}" + "-s" + "-w" + "-X=github.com/influxdata/telegraf/internal.Commit=${src.rev}" + "-X=github.com/influxdata/telegraf/internal.Version=${version}" ]; passthru.tests = { inherit (nixosTests) telegraf; }; From 6a32ac7c6909741dd7bc4c40a209eee987ef9edc Mon Sep 17 00:00:00 2001 From: figsoda Date: Sun, 28 May 2023 10:15:23 -0400 Subject: [PATCH 2/2] telegraf: add version test --- pkgs/servers/monitoring/telegraf/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/monitoring/telegraf/default.nix b/pkgs/servers/monitoring/telegraf/default.nix index 3ae88c9990b0..508f5ee3b070 100644 --- a/pkgs/servers/monitoring/telegraf/default.nix +++ b/pkgs/servers/monitoring/telegraf/default.nix @@ -1,4 +1,10 @@ -{ lib, buildGoModule, fetchFromGitHub, nixosTests }: +{ lib +, buildGoModule +, fetchFromGitHub +, nixosTests +, testers +, telegraf +}: buildGoModule rec { pname = "telegraf"; @@ -25,12 +31,18 @@ buildGoModule rec { "-X=github.com/influxdata/telegraf/internal.Version=${version}" ]; - passthru.tests = { inherit (nixosTests) telegraf; }; + passthru.tests = { + inherit (nixosTests) telegraf; + version = testers.testVersion { + package = telegraf; + }; + }; meta = with lib; { description = "The plugin-driven server agent for collecting & reporting metrics"; - license = licenses.mit; 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 ]; }; }