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