1 { lib, buildGoModule, fetchFromGitHub, go, prometheus-sql-exporter, testers }:
4 pname = "sql_exporter";
7 src = fetchFromGitHub {
8 owner = "justwatchcom";
11 sha256 = "sha256-K7UDmV56VW4TM5YUl+xUWmE8GUAYbWowm/hU7xBG+Hs=";
16 ldflags = let t = "github.com/prometheus/common/version"; in
18 "-X ${t}.Version=${version}"
19 "-X ${t}.Revision=${src.rev}"
20 "-X ${t}.Branch=unknown"
21 "-X ${t}.BuildUser=nix@nixpkgs"
22 "-X ${t}.BuildDate=unknown"
23 "-X ${t}.GoVersion=${lib.getVersion go}"
26 passthru.tests.version = testers.testVersion {
27 package = prometheus-sql-exporter;
28 command = "sql_exporter -version";
32 description = "Flexible SQL exporter for Prometheus";
33 mainProgram = "sql_exporter";
34 homepage = "https://github.com/justwatchcom/sql_exporter";
35 license = licenses.mit;
36 maintainers = with maintainers; [ justinas ];