2021-03-04 12:54:50 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
2020-12-29 17:44:07 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "smokeping_prober";
|
2023-04-20 17:25:42 +00:00
|
|
|
version = "0.6.1";
|
2020-12-29 17:44:07 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = let
|
2023-04-09 01:33:47 +00:00
|
|
|
setVars = rec {
|
|
|
|
Version = version;
|
|
|
|
Revision = "722200c4adbd6d1e5d847dfbbd9dec07aa4ca38d";
|
|
|
|
Branch = Revision;
|
2020-12-29 17:44:07 +00:00
|
|
|
BuildUser = "nix";
|
|
|
|
};
|
|
|
|
varFlags = lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "-X github.com/prometheus/common/version.${name}=${value}") setVars);
|
|
|
|
in [
|
2021-08-26 06:45:51 +00:00
|
|
|
"${varFlags}" "-s" "-w"
|
2020-12-29 17:44:07 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SuperQ";
|
|
|
|
repo = "smokeping_prober";
|
2023-04-09 01:33:47 +00:00
|
|
|
rev = "v${version}";
|
2023-04-20 17:25:42 +00:00
|
|
|
sha256 = "sha256-tph9TZwMWKlJC/YweO9BU3+QRIugqc3ob5rqXThyR1c=";
|
2020-12-29 17:44:07 +00:00
|
|
|
};
|
2023-04-20 17:25:42 +00:00
|
|
|
vendorHash = "sha256-emabuOm5tuPNZWmPHJWUWzFVjuLrY7biv8V/3ru73aU=";
|
2020-12-29 17:44:07 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) smokeping; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-29 17:44:07 +00:00
|
|
|
description = "Prometheus exporter for sending continual ICMP/UDP pings";
|
|
|
|
homepage = "https://github.com/SuperQ/smokeping_prober";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ lukegb ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|