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 {
|
2018-05-17 04:18:07 -07:00
|
|
|
version = "5.1.3";
|
2018-02-27 05:07:49 -08:00
|
|
|
name = "grafana-${version}";
|
2015-11-16 05:28:03 -08:00
|
|
|
goPackagePath = "github.com/grafana/grafana";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2018-05-17 04:18:07 -07:00
|
|
|
sha256 = "09q4xrh4j02b8nrkskndahs039rhmcs8hrcgvnnpg36qqyvs1x0g";
|
2015-11-16 05:28:03 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2017-12-19 17:30:44 -08:00
|
|
|
url = "https://grafana-releases.s3.amazonaws.com/release/grafana-${version}.linux-x64.tar.gz";
|
2018-05-17 04:18:07 -07:00
|
|
|
sha256 = "131dxpjnzhsjh6c0fp48jhxf5piy6wh287pfm2s7pm4ywq9m0q46";
|
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
|
2018-03-01 08:07:50 -08:00
|
|
|
mv grafana-*/{public,conf,tools} $bin/share/grafana/
|
|
|
|
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/tools/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
|
|
|
};
|
|
|
|
}
|