nixpkgs/pkgs/servers/monitoring/prometheus/default.nix

47 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, go, buildGoPackage, fetchFromGitHub }:
2016-06-05 12:34:18 +01:00
2018-03-11 00:08:34 +00:00
let
2016-06-05 12:34:18 +01:00
goPackagePath = "github.com/prometheus/prometheus";
in
buildGoPackage rec {
pname = "prometheus";
version = "2.12.0";
2018-03-11 00:08:34 +00:00
inherit goPackagePath;
2018-03-11 00:08:34 +00:00
src = fetchFromGitHub {
rev = "v${version}";
owner = "prometheus";
repo = "prometheus";
sha256 = "1ci9dc512c1hry1b8jqif0mrnks6w3yagwm3jf69ihcwilr2n7vs";
2016-06-05 12:34:18 +01:00
};
buildFlagsArray = let
t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
in ''
-ldflags=
-X ${t}.Version=${version}
-X ${t}.Revision=unknown
-X ${t}.Branch=unknown
-X ${t}.BuildUser=nix@nixpkgs
-X ${t}.BuildDate=unknown
-X ${t}.GoVersion=${lib.getVersion go}
'';
preInstall = ''
mkdir -p "$bin/share/doc/prometheus" "$bin/etc/prometheus"
cp -a $src/documentation/* $bin/share/doc/prometheus
cp -a $src/console_libraries $src/consoles $bin/etc/prometheus
'';
doCheck = true;
meta = with lib; {
description = "Service monitoring system and time series database";
homepage = "https://prometheus.io";
license = licenses.asl20;
maintainers = with maintainers; [ benley fpletz globin willibutz ];
platforms = platforms.unix;
2016-06-05 12:34:18 +01:00
};
}