nixpkgs/pkgs/servers/monitoring/prometheus/node-exporter.nix

41 lines
1.2 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "node_exporter";
version = "1.2.2";
rev = "v${version}";
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "node_exporter";
sha256 = "11xjbkws3vv5r4p6w6qfmm9wrmlhzwmvlx3vcgz99ylz34r19xvc";
};
vendorSha256 = "0wwji220pidrmsjzd9c3n40v237680av750jf6hdvp0aqi63p9nr";
# FIXME: tests fail due to read-only nix store
doCheck = false;
excludedPackages = [ "docs/node-mixin" ];
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"
];
passthru.tests = { inherit (nixosTests.prometheus-exporters) node; };
meta = with lib; {
description = "Prometheus exporter for machine metrics";
homepage = "https://github.com/prometheus/node_exporter";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz globin Frostman ];
};
}