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

44 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
2015-11-16 13:28:03 +00:00
2016-06-06 00:28:52 +00:00
buildGoPackage rec {
2019-08-15 12:30:23 +00:00
version = "6.3.3";
2018-02-27 13:07:49 +00:00
name = "grafana-${version}";
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";
2019-08-15 12:30:23 +00:00
sha256 = "006j39n42l91krd1p87dpan1s7dvjjhpidccpxkic189lwg7fbxs";
2015-11-16 13:28:03 +00:00
};
srcStatic = fetchurl {
url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-amd64.tar.gz";
2019-08-15 12:30:23 +00:00
sha256 = "0n4fkzj3bnq3x08vw18a8lqxjggqsy5l2rgk494i87yaf1pa4gpf";
2015-11-16 13:28:03 +00: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";
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/
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 12:30:23 +00:00
homepage = "https://grafana.com";
2017-09-05 17:01:01 +00:00
maintainers = with maintainers; [ offline fpletz willibutz ];
platforms = platforms.linux;
2015-11-16 13:28:03 +00:00
};
}