1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 gitUpdater,
6 testers,
7 prometheus-nats-exporter,
8}:
9
10buildGoModule rec {
11 pname = "prometheus-nats-exporter";
12 version = "0.15.0";
13
14 src = fetchFromGitHub {
15 owner = "nats-io";
16 repo = pname;
17 rev = "v${version}";
18 sha256 = "sha256-siucc55qi1SS2R07xgxh25CWYjxncUqvzxo0XoIPyOo=";
19 };
20
21 vendorHash = "sha256-vRUPLKxwVTt3t8UpsSH4yMCIShpYhYI6j7AEmlyOADs=";
22
23 preCheck = ''
24 # Fix `insecure algorithm SHA1-RSA` problem
25 export GODEBUG=x509sha1=1;
26 '';
27
28 ldflags = [
29 "-s"
30 "-w"
31 "-X main.version=${version}"
32 ];
33
34 passthru = {
35 updateScript = gitUpdater { rev-prefix = "v"; };
36 tests = {
37 prometheus-nats-exporter-version = testers.testVersion {
38 package = prometheus-nats-exporter;
39 };
40 };
41 };
42
43 meta = with lib; {
44 description = "Exporter for NATS metrics";
45 homepage = "https://github.com/nats-io/prometheus-nats-exporter";
46 license = licenses.asl20;
47 maintainers = with maintainers; [ bbigras ];
48 };
49}