forked from mirrors/nixpkgs
36 lines
1.2 KiB
Nix
36 lines
1.2 KiB
Nix
{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
|
|
|
|
buildGoPackage rec {
|
|
version = "4.4.3";
|
|
name = "grafana-v${version}";
|
|
goPackagePath = "github.com/grafana/grafana";
|
|
|
|
src = fetchFromGitHub {
|
|
rev = "v${version}";
|
|
owner = "grafana";
|
|
repo = "grafana";
|
|
sha256 = "04cm8h7if8yvczcwd83drbfzgr1spfspzg5im8lb540ks9x55dz4";
|
|
};
|
|
|
|
srcStatic = fetchurl {
|
|
url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-x64.tar.gz";
|
|
sha256 = "1p36hniay2y3mwg300b7n3sl3vv7l5jq5ddcnmpmznwyd8zwbl4h";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
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;
|
|
};
|
|
}
|