nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8buildGoModule rec {
9 pname = "blackbox_exporter";
10 version = "0.28.0";
11 rev = "v${version}";
12
13 src = fetchFromGitHub {
14 inherit rev;
15 owner = "prometheus";
16 repo = "blackbox_exporter";
17 sha256 = "sha256-Wt4AVBDptGJ4BlPzdaym5YyXRo0ApBDGEhoSrX7oRf4=";
18 };
19
20 vendorHash = "sha256-WhXKBG1eCbXFQZmLwKsxjVV6uAfCMEIqco8Jr+vNdPI=";
21
22 # dns-lookup is performed for the tests
23 doCheck = false;
24
25 passthru.tests = { inherit (nixosTests.prometheus-exporters) blackbox; };
26
27 ldflags = [
28 "-s"
29 "-w"
30 "-X github.com/prometheus/common/version.Version=${version}"
31 "-X github.com/prometheus/common/version.Revision=${rev}"
32 "-X github.com/prometheus/common/version.Branch=unknown"
33 "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
34 "-X github.com/prometheus/common/version.BuildDate=unknown"
35 ];
36
37 meta = {
38 description = "Blackbox probing of endpoints over HTTP, HTTPS, DNS, TCP and ICMP";
39 mainProgram = "blackbox_exporter";
40 homepage = "https://github.com/prometheus/blackbox_exporter";
41 license = lib.licenses.asl20;
42 maintainers = with lib.maintainers; [
43 globin
44 fpletz
45 Frostman
46 ma27
47 ];
48 };
49}