Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6 makeWrapper,
7 freeipmi,
8}:
9
10buildGoModule rec {
11 pname = "ipmi_exporter";
12 version = "1.10.1";
13
14 src = fetchFromGitHub {
15 owner = "prometheus-community";
16 repo = "ipmi_exporter";
17 rev = "v${version}";
18 hash = "sha256-U4vkOKxHKJyfsngn2JqZncq71BohBnGM7Z1hA79YhKA=";
19 };
20
21 vendorHash = "sha256-8ebarbsaHiufPEghgOlaRMouGdI1c1Yo8pjqG2bPdK8=";
22
23 nativeBuildInputs = [ makeWrapper ];
24
25 postInstall = ''
26 wrapProgram $out/bin/ipmi_exporter --prefix PATH : ${lib.makeBinPath [ freeipmi ]}
27 '';
28
29 passthru.tests = { inherit (nixosTests.prometheus-exporters) ipmi; };
30
31 ldflags = [
32 "-s"
33 "-w"
34 "-X github.com/prometheus/common/version.Version=${version}"
35 "-X github.com/prometheus/common/version.Revision=0000000"
36 "-X github.com/prometheus/common/version.Branch=unknown"
37 "-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
38 "-X github.com/prometheus/common/version.BuildDate=unknown"
39 ];
40
41 meta = with lib; {
42 description = "IPMI exporter for Prometheus";
43 mainProgram = "ipmi_exporter";
44 homepage = "https://github.com/prometheus-community/ipmi_exporter";
45 changelog = "https://github.com/prometheus-community/ipmi_exporter/blob/${src.rev}/CHANGELOG.md";
46 license = licenses.mit;
47 maintainers = with maintainers; [ snaar ];
48 };
49}