2022-09-02 13:37:19 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
nixosTests,
|
|
|
|
makeWrapper,
|
|
|
|
freeipmi,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "ipmi_exporter";
|
2024-10-18 06:00:40 +00:00
|
|
|
version = "1.9.0";
|
2022-09-02 13:37:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "prometheus-community";
|
|
|
|
repo = "ipmi_exporter";
|
|
|
|
rev = "v${version}";
|
2024-10-18 06:00:40 +00:00
|
|
|
hash = "sha256-0JNt3XbXGbAfaBQ13X/vrBhhN39hY4kwoBQ9obxsAd0=";
|
2022-09-02 13:37:19 +00:00
|
|
|
};
|
|
|
|
|
2024-10-18 06:00:40 +00:00
|
|
|
vendorHash = "sha256-dUf++LhoKWJxQfu9Latr8mCkeid5EAi+6yRdWDkTeP8=";
|
2022-09-02 13:37:19 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/ipmi_exporter --prefix PATH : ${lib.makeBinPath [ freeipmi ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) ipmi; };
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/prometheus/common/version.Version=${version}"
|
|
|
|
"-X github.com/prometheus/common/version.Revision=0000000"
|
|
|
|
"-X github.com/prometheus/common/version.Branch=unknown"
|
|
|
|
"-X github.com/prometheus/common/version.BuildUser=nix@nixpkgs"
|
|
|
|
"-X github.com/prometheus/common/version.BuildDate=unknown"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "IPMI exporter for Prometheus";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "ipmi_exporter";
|
2022-09-02 13:37:19 +00:00
|
|
|
homepage = "https://github.com/prometheus-community/ipmi_exporter";
|
|
|
|
changelog = "https://github.com/prometheus-community/ipmi_exporter/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ snaar ];
|
|
|
|
};
|
|
|
|
}
|