mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-01 11:22:58 +00:00
ff1a94e523
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
48 lines
1.4 KiB
Nix
48 lines
1.4 KiB
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests
|
|
# darwin
|
|
, CoreFoundation, IOKit
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "node_exporter";
|
|
version = "1.7.0";
|
|
rev = "v${version}";
|
|
|
|
src = fetchFromGitHub {
|
|
inherit rev;
|
|
owner = "prometheus";
|
|
repo = "node_exporter";
|
|
sha256 = "sha256-+KY/YXEqT/40QzODOk8lKAo0zMcNuiMvj6ippbJE9ho=";
|
|
};
|
|
|
|
vendorHash = "sha256-HrlzDupZP9+GxB58Lg62tvku1Sl2zo2iV0KnBNwkM58=";
|
|
|
|
# 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";
|
|
mainProgram = "node_exporter";
|
|
homepage = "https://github.com/prometheus/node_exporter";
|
|
changelog = "https://github.com/prometheus/node_exporter/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ benley fpletz globin Frostman ];
|
|
};
|
|
}
|