2016-07-15 15:26:31 +02:00
|
|
|
{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
|
2015-11-16 14:28:03 +01:00
|
|
|
|
2016-06-06 02:28:52 +02:00
|
|
|
buildGoPackage rec {
|
2016-12-01 01:33:39 +01:00
|
|
|
version = "4.0.0";
|
|
|
|
ts = "1480439068";
|
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";
|
2016-12-01 01:33:39 +01:00
|
|
|
sha256 = "0ps9bi4mnb3k6g2824crhyb804srk2b4d2j9k306vg0cizirn75c";
|
2015-11-16 14:28:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2016-07-19 00:14:40 +02:00
|
|
|
url = "https://grafanarel.s3.amazonaws.com/builds/grafana-${version}-${ts}.linux-x64.tar.gz";
|
2016-12-01 01:33:39 +01:00
|
|
|
sha256 = "10n3vmmyr1rvq29r5cz1rwz60smavj6fahz4vaqldh1v0qyqzjlm";
|
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
|
2016-07-15 15:26:31 +02:00
|
|
|
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;
|
|
|
|
homepage = http://grafana.org/;
|
2016-05-13 02:28:24 +02:00
|
|
|
maintainers = with maintainers; [ offline fpletz ];
|
2015-11-18 11:33:50 +01:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 14:28:03 +01:00
|
|
|
};
|
|
|
|
}
|