Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / monitoring / prometheus / ipmi-exporter.nix
blobb371008dc0b9a2c5b9b8184a7eb4d51d1a41bafe
1 { lib, buildGoModule, fetchFromGitHub, nixosTests, makeWrapper, freeipmi }:
3 buildGoModule rec {
4   pname = "ipmi_exporter";
5   version = "1.8.0";
7   src = fetchFromGitHub {
8     owner = "prometheus-community";
9     repo = "ipmi_exporter";
10     rev = "v${version}";
11     hash = "sha256-ZF5mBjq+IhSQrQ1dUfHlfyUMK2dkpZ5gu9djPkUYvRQ=";
12   };
14   vendorHash = "sha256-q5MFAvFCrr24b1VO0Z03C08CGd+0pUerXZEKiu4r7cE=";
16   nativeBuildInputs = [ makeWrapper ];
18   postInstall = ''
19     wrapProgram $out/bin/ipmi_exporter --prefix PATH : ${lib.makeBinPath [ freeipmi ]}
20   '';
22   passthru.tests = { inherit (nixosTests.prometheus-exporters) ipmi; };
24   ldflags = [
25     "-s"
26     "-w"
27     "-X github.com/prometheus/common/version.Version=${version}"
28     "-X github.com/prometheus/common/version.Revision=0000000"
29     "-X github.com/prometheus/common/version.Branch=unknown"
30     "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
31     "-X github.com/prometheus/common/version.BuildDate=unknown"
32   ];
34   meta = with lib; {
35     description = "IPMI exporter for Prometheus";
36     mainProgram = "ipmi_exporter";
37     homepage = "https://github.com/prometheus-community/ipmi_exporter";
38     changelog = "https://github.com/prometheus-community/ipmi_exporter/blob/${src.rev}/CHANGELOG.md";
39     license = licenses.mit;
40     maintainers = with maintainers; [ snaar ];
41   };