2016-07-15 14:26:31 +01:00
|
|
|
{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
|
2015-11-16 13:28:03 +00:00
|
|
|
|
2016-06-06 01:28:52 +01:00
|
|
|
buildGoPackage rec {
|
2018-08-22 22:44:14 +01:00
|
|
|
version = "5.2.3";
|
2018-02-27 13:07:49 +00:00
|
|
|
name = "grafana-${version}";
|
2015-11-16 13:28:03 +00:00
|
|
|
goPackagePath = "github.com/grafana/grafana";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2018-08-22 22:44:14 +01:00
|
|
|
sha256 = "08ws8kpqxl0rihw8xa93285gal6f6c3imymdi9iif13vsn458hiw";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2018-06-27 16:18:49 +01:00
|
|
|
url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-amd64.tar.gz";
|
2018-08-22 22:44:14 +01:00
|
|
|
sha256 = "098xrzq7wkizww9552bk8cn300336y51qfzf1fkfwrn1fqf9nswl";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
2018-06-27 16:18:49 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pkg/cmd/grafana-server/main.go \
|
|
|
|
--replace 'var version = "5.0.0"' 'var version = "${version}"'
|
|
|
|
'';
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
preBuild = "export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace";
|
2018-06-27 16:18:49 +01:00
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
postInstall = ''
|
|
|
|
tar -xvf $srcStatic
|
|
|
|
mkdir -p $bin/share/grafana
|
2018-03-01 16:07:50 +00:00
|
|
|
mv grafana-*/{public,conf,tools} $bin/share/grafana/
|
|
|
|
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/tools/phantomjs/phantomjs
|
2015-11-16 13:28:03 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
|
|
|
|
license = licenses.asl20;
|
2017-09-05 18:01:01 +01:00
|
|
|
homepage = https://grafana.org/;
|
|
|
|
maintainers = with maintainers; [ offline fpletz willibutz ];
|
2015-11-18 10:33:50 +00:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
}
|