2022-03-24 16:24:40 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests
|
|
|
|
# darwin
|
|
|
|
, CoreFoundation, IOKit
|
|
|
|
}:
|
2016-06-05 13:52:16 +00:00
|
|
|
|
2021-05-11 05:02:02 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "node_exporter";
|
2023-07-23 11:35:58 +00:00
|
|
|
version = "1.6.1";
|
2016-12-01 00:34:21 +00:00
|
|
|
rev = "v${version}";
|
2016-06-28 13:32:22 +00:00
|
|
|
|
2016-06-06 10:26:56 +00:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 13:52:16 +00:00
|
|
|
inherit rev;
|
2016-06-06 10:26:56 +00:00
|
|
|
owner = "prometheus";
|
|
|
|
repo = "node_exporter";
|
2023-07-23 11:35:58 +00:00
|
|
|
sha256 = "sha256-BCZLMSJP/63N+pZsK8er87Zem7IFGdkyruDs6UVDZSM=";
|
2016-06-05 13:52:16 +00:00
|
|
|
};
|
|
|
|
|
2023-05-29 05:31:42 +00:00
|
|
|
vendorHash = "sha256-hn2cMKhLl5qsm4sZErs6PXTs8yajowxw9a9vtHe5cAk=";
|
2021-05-11 05:02:02 +00:00
|
|
|
|
2018-06-18 17:21:20 +00:00
|
|
|
# FIXME: tests fail due to read-only nix store
|
2016-06-28 13:32:22 +00:00
|
|
|
doCheck = false;
|
2016-06-05 13:52:16 +00:00
|
|
|
|
2022-03-24 16:24:40 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ CoreFoundation IOKit ];
|
|
|
|
|
2021-05-11 05:02:02 +00:00
|
|
|
excludedPackages = [ "docs/node-mixin" ];
|
|
|
|
|
2021-07-29 13:09:02 +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"
|
|
|
|
];
|
2019-06-25 07:17:46 +00:00
|
|
|
|
2020-06-18 10:48:40 +00:00
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-05 13:52:16 +00:00
|
|
|
description = "Prometheus exporter for machine metrics";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/prometheus/node_exporter";
|
2023-07-23 11:36:00 +00:00
|
|
|
changelog = "https://github.com/prometheus/node_exporter/blob/v${version}/CHANGELOG.md";
|
2016-06-05 13:52:16 +00:00
|
|
|
license = licenses.asl20;
|
2020-05-26 19:09:43 +00:00
|
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
2016-06-05 13:52:16 +00:00
|
|
|
};
|
|
|
|
}
|