Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / monitoring / prometheus / sql-exporter.nix
blobbca77e93151ef63e468acf23137555e17cb032a3
1 { lib, buildGoModule, fetchFromGitHub, go, prometheus-sql-exporter, testers }:
3 buildGoModule rec {
4   pname = "sql_exporter";
5   version = "0.5.5";
7   src = fetchFromGitHub {
8     owner = "justwatchcom";
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "sha256-K7UDmV56VW4TM5YUl+xUWmE8GUAYbWowm/hU7xBG+Hs=";
12   };
14   vendorHash = null;
16   ldflags = let t = "github.com/prometheus/common/version"; in
17     [
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}"
24     ];
26   passthru.tests.version = testers.testVersion {
27     package = prometheus-sql-exporter;
28     command = "sql_exporter -version";
29   };
31   meta = with lib; {
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 ];
37   };