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 {
|
2018-03-28 17:42:40 +02:00
|
|
|
version = "5.0.4";
|
2018-02-27 14:07:49 +01:00
|
|
|
name = "grafana-${version}";
|
2015-11-16 14:28:03 +01:00
|
|
|
goPackagePath = "github.com/grafana/grafana";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2018-03-28 17:42:40 +02:00
|
|
|
sha256 = "18f69985a5j6fd2ax6z50yfss70phdh1vwyx0z69j145zac3sf90";
|
2015-11-16 14:28:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2017-12-20 02:30:44 +01:00
|
|
|
url = "https://grafana-releases.s3.amazonaws.com/release/grafana-${version}.linux-x64.tar.gz";
|
2018-03-28 17:42:40 +02:00
|
|
|
sha256 = "0xdpqf8n3ds0g7nhbiwahhdj0hfc4biz69rhkl48vm31idlr92sc";
|
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
|
2018-03-01 17:07:50 +01:00
|
|
|
mv grafana-*/{public,conf,tools} $bin/share/grafana/
|
|
|
|
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/tools/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 ];
|
2015-11-18 11:33:50 +01:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 14:28:03 +01:00
|
|
|
};
|
|
|
|
}
|