depot/third_party/nixpkgs/pkgs/servers/monitoring/prometheus/smokeping-prober.nix
Default email 58849dfc4f Project import generated by Copybara.
GitOrigin-RevId: 21c937f8cb1e6adcfeb36dfd6c90d9d9bfab1d28
2021-08-27 16:25:00 +02:00

42 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
let
baseVersion = "0.4.2";
commit = "722200c4adbd6d1e5d847dfbbd9dec07aa4ca38d";
in
buildGoModule rec {
pname = "smokeping_prober";
version = "${baseVersion}-g${commit}";
ldflags = 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 [
"${varFlags}" "-s" "-w"
];
src = fetchFromGitHub {
rev = commit;
owner = "SuperQ";
repo = "smokeping_prober";
sha256 = "1lpcjip6qxhalldgm6i2kgbajfqy3vwfyv9jy0jdpii13lv6mzlz";
};
vendorSha256 = "0p2jmlxpvpaqc445j39b4z4i3mnjrm25khv3sq6ylldcgfd31vz8";
doCheck = true;
passthru.tests = { inherit (nixosTests.prometheus-exporters) smokeping; };
meta = with lib; {
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;
};
}