nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6}:
7
8buildGoModule rec {
9 pname = "nginx_exporter";
10 version = "1.5.1";
11
12 src = fetchFromGitHub {
13 owner = "nginxinc";
14 repo = "nginx-prometheus-exporter";
15 rev = "v${version}";
16 sha256 = "sha256-BJf5gL+bkT6g28OVhGM29IwuLfFz3HPAo/DZzg5Eoqk=";
17 };
18
19 vendorHash = "sha256-lMLJvfB85kGAaPffRd7fz+PAFddSnVS2kzJHRKdnGH4=";
20
21 ldflags =
22 let
23 t = "github.com/prometheus/common/version";
24 in
25 [
26 "-s"
27 "-w"
28 "-X ${t}.Version=${version}"
29 "-X ${t}.Branch=unknown"
30 "-X ${t}.BuildUser=nix@nixpkgs"
31 "-X ${t}.BuildDate=unknown"
32 ];
33
34 passthru.tests = { inherit (nixosTests.prometheus-exporters) nginx; };
35
36 meta = {
37 description = "NGINX Prometheus Exporter for NGINX and NGINX Plus";
38 mainProgram = "nginx-prometheus-exporter";
39 homepage = "https://github.com/nginxinc/nginx-prometheus-exporter";
40 license = lib.licenses.asl20;
41 maintainers = with lib.maintainers; [
42 benley
43 fpletz
44 globin
45 ];
46 };
47}