2024-07-27 06:49:29 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests, darwin }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "node_exporter";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.8.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "prometheus";
|
|
|
|
repo = "node_exporter";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-b2uior67RcCCpUE+qx55G1eWiT2wWDVsnosSH9fd3/I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
vendorHash = "sha256-sly8AJk+jNZG8ijTBF1Pd5AOOUJJxIG8jHwBUdlt8fM=";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# FIXME: tests fail due to read-only nix store
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation IOKit ]);
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
excludedPackages = [ "docs/node-mixin" ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/prometheus/common/version.Version=${version}"
|
|
|
|
"-X github.com/prometheus/common/version.Revision=${rev}"
|
|
|
|
"-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"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Prometheus exporter for machine metrics";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "node_exporter";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/prometheus/node_exporter";
|
2023-08-04 22:07:22 +00:00
|
|
|
changelog = "https://github.com/prometheus/node_exporter/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2020-05-29 06:06:01 +00:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|