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

36 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
2015-11-16 14:28:03 +01:00
2016-06-06 02:28:52 +02:00
buildGoPackage rec {
2017-10-01 23:04:22 +02:00
version = "4.5.2";
2015-11-16 14:28:03 +01:00
name = "grafana-v${version}";
goPackagePath = "github.com/grafana/grafana";
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "grafana";
2017-10-01 23:04:22 +02:00
sha256 = "1sgrnk90hn99c1xq49al5n76j2qqfi7sjc6r2fr00gd7mxzbh1mg";
2015-11-16 14:28:03 +01:00
};
srcStatic = fetchurl {
2017-05-31 08:55:09 +02:00
url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-x64.tar.gz";
2017-10-01 23:04:22 +02:00
sha256 = "19l1abq8qklhsqq1z4mi08c9z139b8gfyay7pwp4xmjxfzpsff64";
2015-11-16 14:28:03 +01:00
};
preBuild = "export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace";
postInstall = ''
tar -xvf $srcStatic
mkdir -p $bin/share/grafana
mv grafana-*/{public,conf,vendor} $bin/share/grafana/
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/vendor/phantomjs/phantomjs
2015-11-16 14:28:03 +01:00
'';
meta = with lib; {
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
license = licenses.asl20;
2017-09-05 19:01:01 +02:00
homepage = https://grafana.org/;
maintainers = with maintainers; [ offline fpletz willibutz ];
platforms = platforms.linux;
2015-11-16 14:28:03 +01:00
};
}