2020-02-20 21:05:20 +00:00
|
|
|
{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomJsSupport ? false, phantomjs2 ? null }:
|
2015-11-16 13:28:03 +00:00
|
|
|
|
2016-06-06 01:28:52 +01:00
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "grafana";
|
2020-02-20 16:33:16 +00:00
|
|
|
version = "6.6.2";
|
2019-08-31 08:50:38 +01:00
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
goPackagePath = "github.com/grafana/grafana";
|
|
|
|
|
2019-02-26 19:30:02 +00:00
|
|
|
excludedPackages = [ "release_publisher" ];
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2020-02-20 16:33:16 +00:00
|
|
|
sha256 = "0zbc9jcr3w7rwsv96csqaifn5d0b435wyrrajr5wzsmhljygvrcy";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2019-08-29 16:16:47 +01:00
|
|
|
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
2020-02-20 16:33:16 +00:00
|
|
|
sha256 = "1plijm7cy92k79ypcnxjmdf2vhlxa4dzwjyl9lkf2npm7kswswsl";
|
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/
|
2020-02-20 21:05:20 +00:00
|
|
|
'' + lib.optionalString phantomJsSupport ''
|
2018-03-01 16:07:50 +00:00
|
|
|
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;
|
2019-08-15 13:30:23 +01:00
|
|
|
homepage = "https://grafana.com";
|
2020-02-06 21:17:37 +00:00
|
|
|
maintainers = with maintainers; [ offline fpletz willibutz globin ma27 ];
|
2015-11-18 10:33:50 +00:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
}
|