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

58 lines
1.5 KiB
Nix
Raw Normal View History

2015-05-30 01:56:17 +00:00
{ stdenv, lib, goPackages, fetchFromGitHub, vim }:
let self = goPackages.buildGoPackage rec {
2015-05-30 01:56:17 +00:00
name = "prometheus-${version}";
2015-08-29 07:11:59 +00:00
version = "0.15.1";
2015-05-30 01:56:17 +00:00
goPackagePath = "github.com/prometheus/prometheus";
2015-08-29 07:11:59 +00:00
rev = "64349aade284846cb194be184b1b180fca629a7c";
2015-05-30 01:56:17 +00:00
src = fetchFromGitHub {
inherit rev;
owner = "prometheus";
repo = "prometheus";
2015-08-29 07:11:59 +00:00
sha256 = "0gljpwnlip1fnmhbc96hji2rc56xncy97qccm7v1z5j1nhc5fam2";
2015-05-30 01:56:17 +00:00
};
2015-08-29 07:11:59 +00:00
buildInputs = with goPackages; [
consul
dns
fsnotify.v1
go-zookeeper
goleveldb
httprouter
logrus
net
prometheus.client_golang
prometheus.log
yaml-v2
2015-05-30 01:56:17 +00:00
];
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
'';
2015-05-30 01:56:17 +00:00
# Metadata that gets embedded into the binary
2015-08-29 07:11:59 +00:00
buildFlagsArray = let t = "${goPackagePath}/version"; in
''
2015-05-30 01:56:17 +00:00
-ldflags=
2015-08-29 07:11:59 +00:00
-X ${t}.Version=${version}
-X ${t}.Revision=${builtins.substring 0 6 rev}
-X ${t}.Branch=master
-X ${t}.BuildUser=nix@nixpkgs
-X ${t}.BuildDate=20150101-00:00:00
-X ${t}.GoVersion=${lib.getVersion goPackages.go}
2015-05-30 01:56:17 +00:00
'';
2015-05-30 01:56:17 +00:00
meta = with lib; {
description = "Service monitoring system and time series database";
homepage = http://prometheus.io;
license = licenses.asl20;
maintainers = with maintainers; [ benley ];
platforms = platforms.unix;
};
};
in self.bin