mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-03 20:33:21 +00:00
46 lines
1.3 KiB
Nix
46 lines
1.3 KiB
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests
|
|
# darwin
|
|
, CoreFoundation, IOKit
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "node_exporter";
|
|
version = "1.6.0";
|
|
rev = "v${version}";
|
|
|
|
src = fetchFromGitHub {
|
|
inherit rev;
|
|
owner = "prometheus";
|
|
repo = "node_exporter";
|
|
sha256 = "sha256-Aw1tdaiyr3wv3Ti3CFn2T80WRjEZaACwotKKJGY9I6Y=";
|
|
};
|
|
|
|
vendorHash = "sha256-hn2cMKhLl5qsm4sZErs6PXTs8yajowxw9a9vtHe5cAk=";
|
|
|
|
# FIXME: tests fail due to read-only nix store
|
|
doCheck = false;
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ CoreFoundation IOKit ];
|
|
|
|
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 ];
|
|
};
|
|
}
|