nixpkgs/pkgs/servers/monitoring/grafana/default.nix

36 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
2015-11-16 13:28:03 +00:00
2016-06-06 01:28:52 +01:00
buildGoPackage rec {
2017-12-15 13:52:37 +00:00
version = "4.6.3";
2015-11-16 13:28:03 +00:00
name = "grafana-v${version}";
goPackagePath = "github.com/grafana/grafana";
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "grafana";
2017-12-15 13:52:37 +00:00
sha256 = "18r35pwarbgamhd7m9z4wpx6x1ymd5qsymvfll58zcgivis6c32j";
2015-11-16 13:28:03 +00:00
};
srcStatic = fetchurl {
url = "https://grafana-releases.s3.amazonaws.com/release/grafana-${version}.linux-x64.tar.gz";
2017-12-15 13:52:37 +00:00
sha256 = "01f50w57n7p7if37rhj8zy0y0x84qajbxrrdcfrsbi2qi1kzfz03";
2015-11-16 13:28:03 +00:00
};
preBuild = "export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace";
postInstall = ''
tar -xvf $srcStatic
mkdir -p $bin/share/grafana
mv grafana-*/{public,conf,vendor} $bin/share/grafana/
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/vendor/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 ];
platforms = platforms.linux;
2015-11-16 13:28:03 +00:00
};
}