2021-03-04 12:54:50 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
|
2020-12-29 17:44:07 +00:00
|
|
|
|
|
|
|
let
|
2021-05-11 19:53:02 +01:00
|
|
|
baseVersion = "0.4.2";
|
|
|
|
commit = "722200c4adbd6d1e5d847dfbbd9dec07aa4ca38d";
|
2020-12-29 17:44:07 +00:00
|
|
|
in
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "smokeping_prober";
|
|
|
|
version = "${baseVersion}-g${commit}";
|
|
|
|
|
|
|
|
buildFlagsArray = let
|
|
|
|
setVars = {
|
|
|
|
Version = baseVersion;
|
|
|
|
Revision = commit;
|
|
|
|
Branch = commit;
|
|
|
|
BuildUser = "nix";
|
|
|
|
};
|
|
|
|
varFlags = lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "-X github.com/prometheus/common/version.${name}=${value}") setVars);
|
|
|
|
in [
|
|
|
|
"-ldflags=${varFlags} -s -w"
|
|
|
|
];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = commit;
|
|
|
|
owner = "SuperQ";
|
|
|
|
repo = "smokeping_prober";
|
2021-05-11 19:53:02 +01:00
|
|
|
sha256 = "1lpcjip6qxhalldgm6i2kgbajfqy3vwfyv9jy0jdpii13lv6mzlz";
|
2020-12-29 17:44:07 +00:00
|
|
|
};
|
2021-05-11 19:53:02 +01:00
|
|
|
vendorSha256 = "0p2jmlxpvpaqc445j39b4z4i3mnjrm25khv3sq6ylldcgfd31vz8";
|
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;
|
|
|
|
};
|
|
|
|
}
|