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 {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "grafana";
|
2019-10-16 08:06:01 -07:00
|
|
|
version = "6.4.3";
|
2019-08-31 00:50:38 -07:00
|
|
|
|
2015-11-16 05:28:03 -08:00
|
|
|
goPackagePath = "github.com/grafana/grafana";
|
|
|
|
|
2019-02-26 11:30:02 -08:00
|
|
|
excludedPackages = [ "release_publisher" ];
|
|
|
|
|
2015-11-16 05:28:03 -08:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2019-10-16 08:06:01 -07:00
|
|
|
sha256 = "0150s14yjgshncs94xf42yrz7awvw2x91j0j9v23fypqmlch2p3m";
|
2015-11-16 05:28:03 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2019-08-29 08:16:47 -07:00
|
|
|
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
2019-10-16 08:06:01 -07:00
|
|
|
sha256 = "0gr9m05h8qx3g0818b0qf1w26pdir3c5ydgi9zwdhjkppsq14dq2";
|
2015-11-16 05:28:03 -08:00
|
|
|
};
|
|
|
|
|
2018-06-27 08:18:49 -07:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pkg/cmd/grafana-server/main.go \
|
|
|
|
--replace 'var version = "5.0.0"' 'var version = "${version}"'
|
|
|
|
'';
|
|
|
|
|
2015-11-16 05:28:03 -08:00
|
|
|
preBuild = "export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace";
|
2018-06-27 08:18:49 -07:00
|
|
|
|
2015-11-16 05:28:03 -08:00
|
|
|
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;
|
2019-08-15 05:30:23 -07:00
|
|
|
homepage = "https://grafana.com";
|
2019-08-20 10:36:05 -07:00
|
|
|
maintainers = with maintainers; [ offline fpletz willibutz globin ];
|
2015-11-18 02:33:50 -08:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 05:28:03 -08:00
|
|
|
};
|
|
|
|
}
|