1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 15:11:35 +00:00
nixpkgs/pkgs/servers/monitoring/grafana/default.nix
2019-06-17 15:43:25 +02:00

44 lines
1.3 KiB
Nix

{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
buildGoPackage rec {
version = "6.2.3";
name = "grafana-${version}";
goPackagePath = "github.com/grafana/grafana";
excludedPackages = [ "release_publisher" ];
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "grafana";
sha256 = "1x0wwwgr8zvddjhdjfdj8i1l8b19m6mr4wq3cng32abxb3md7j39";
};
srcStatic = fetchurl {
url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-amd64.tar.gz";
sha256 = "0l892jgpijkd5x2dv0g3dnjj7nk0n97wcvw220bg7cqpz7gbpivi";
};
postPatch = ''
substituteInPlace pkg/cmd/grafana-server/main.go \
--replace 'var version = "5.0.0"' 'var version = "${version}"'
'';
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;
};
}