prometheus-nats-exporter: add updateScript and testVersion

This commit is contained in:
Bruno Bigras
2024-08-24 01:02:39 -04:00
parent 0b6fa5ee40
commit 437d92c6ad
@@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, gitUpdater, testers, prometheus-nats-exporter }:
buildGoModule rec {
pname = "prometheus-nats-exporter";
@@ -18,6 +18,21 @@ buildGoModule rec {
export GODEBUG=x509sha1=1;
'';
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
prometheus-nats-exporter-version = testers.testVersion {
package = prometheus-nats-exporter;
};
};
};
meta = with lib; {
description = "Exporter for NATS metrics";
homepage = "https://github.com/nats-io/prometheus-nats-exporter";