2020-06-18 10:48:40 +00:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, nixosTests }:
|
2016-06-05 13:52:16 +00:00
|
|
|
|
2019-01-11 03:11:31 +00:00
|
|
|
buildGoPackage rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "node_exporter";
|
2020-06-16 15:10:24 +00:00
|
|
|
version = "1.0.1";
|
2016-12-01 00:34:21 +00:00
|
|
|
rev = "v${version}";
|
2016-06-28 13:32:22 +00:00
|
|
|
|
2016-06-05 13:52:16 +00:00
|
|
|
goPackagePath = "github.com/prometheus/node_exporter";
|
|
|
|
|
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";
|
2020-06-16 15:10:24 +00:00
|
|
|
sha256 = "1r0xx81r9v019fl0iv078yl21ndhb356y7s7zx171zi02k7a4p2l";
|
2016-06-05 13:52:16 +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
|
|
|
|
2019-06-25 07:17:46 +00:00
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X ${goPackagePath}/vendor/github.com/prometheus/common/version.Version=${version}
|
|
|
|
-X ${goPackagePath}/vendor/github.com/prometheus/common/version.Revision=${rev}
|
|
|
|
'';
|
|
|
|
|
2020-06-18 10:48:40 +00:00
|
|
|
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
|
|
|
|
|
2016-06-05 13:52:16 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Prometheus exporter for machine metrics";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/prometheus/node_exporter";
|
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
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|