summary refs log tree commit diff
path: root/pkgs/servers/monitoring/prometheus/default.nix
diff options
context:
space:
mode:
authorBenjamin Staffin <ben@folsomlabs.com>2015-02-17 14:28:56 -0800
committerBenjamin Staffin <ben@folsomlabs.com>2015-03-23 12:06:57 -0700
commit9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d (patch)
tree5f5146b493ef1db539ac3024672dab5ea21c8762 /pkgs/servers/monitoring/prometheus/default.nix
parent55bbb4fb0b8e0a803588be418fc749a97780a7f7 (diff)
downloadnixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.tar
nixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.tar.gz
nixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.tar.bz2
nixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.tar.lz
nixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.tar.xz
nixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.tar.zst
nixpkgs-9c1f0b33a3dd4e7d374c9cfcdf0b6c67efd0a09d.zip
New package: Prometheus monitoring system
Diffstat (limited to 'pkgs/servers/monitoring/prometheus/default.nix')
-rw-r--r--pkgs/servers/monitoring/prometheus/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/servers/monitoring/prometheus/default.nix b/pkgs/servers/monitoring/prometheus/default.nix
new file mode 100644
index 00000000000..4c05a859f01
--- /dev/null
+++ b/pkgs/servers/monitoring/prometheus/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, lib, goPackages, fetchFromGitHub, protobuf, vim }:
+
+with goPackages;
+
+buildGoPackage rec {
+   name = "prometheus-${version}";
+   version = "0.10.0";
+   goPackagePath = "github.com/prometheus/prometheus";
+   rev = "f5a0f7fa185dae2c772a5847a7aac9ba33b545f9";
+
+   src = fetchFromGitHub {
+     inherit rev;
+     owner = "prometheus";
+     repo = "prometheus";
+     sha256 = "1wagmr4bca8fbvi48n9p4hdnx1m4chyaa1bzman6dhqfmkiikf5q";
+   };
+
+   buildInputs = [
+     dns glog goleveldb prometheus.client_golang
+     goPackages.protobuf
+     protobuf  # the non-golang package, for protoc
+     vim  # for xxd, used in embed-static.sh
+   ];
+
+   # Metadata that gets embedded into the binary
+   buildFlagsArray = ''
+     -ldflags=
+         -X main.buildVersion ${version}
+         -X main.buildRevision ${builtins.substring 0 6 rev}
+         -X main.buildBranch master
+         -X main.buildUser nix@nixpkgs
+         -X main.buildDate 20150101-00:00:00
+         -X main.goVersion ${lib.getVersion go}
+   '';
+
+   preBuild = ''
+   (
+     cd "go/src/$goPackagePath"
+     protoc --proto_path=./config \
+            --go_out=./config/generated/ \
+            ./config/config.proto
+
+     cd web
+     ${stdenv.shell} ../utility/embed-static.sh static templates \
+       | gofmt > blob/files.go
+   )
+   '';
+
+   meta = with lib; {
+     description = "Service monitoring system and time series database";
+     homepage = http://prometheus.github.io;
+     license = licenses.asl20;
+     maintainers = with maintainers; [ benley ];
+     platforms = platforms.unix;
+   };
+}