nixpkgs/pkgs/servers/monitoring/grafana/default.nix
2018-03-01 17:50:09 +01:00

35 lines
1.1 KiB
Nix

{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
buildGoPackage rec {
version = "5.0.0";
name = "grafana-${version}";
goPackagePath = "github.com/grafana/grafana";
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "grafana";
sha256 = "1clkvi651wc4zx9bql5iwwnjgwgrj34dirs7ypi6rdgxissp89p9";
};
srcStatic = fetchurl {
url = "https://grafana-releases.s3.amazonaws.com/release/grafana-${version}.linux-x64.tar.gz";
sha256 = "1n2l5ybscc0g1npsa648wjwwb4qrj3f549nf0y6wsifp5k051lhd";
};
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,tools} $bin/share/grafana/
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/tools/phantomjs/phantomjs
'';
meta = with lib; {
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
license = licenses.asl20;
homepage = https://grafana.org/;
maintainers = with maintainers; [ offline fpletz willibutz ];
platforms = platforms.linux;
};
}