3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/monitoring/grafana/default.nix
WilliButz 5be7fd4d86
grafana: 6.1.4 -> 6.1.6
Includes security fix for CVE-2018-19039.
2019-04-29 16:48:22 +02:00

44 lines
1.3 KiB
Nix

{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
buildGoPackage rec {
version = "6.1.6";
name = "grafana-${version}";
goPackagePath = "github.com/grafana/grafana";
excludedPackages = [ "release_publisher" ];
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "grafana";
sha256 = "12fj3j1w37nm8p2h4af38wbxkvm0pzf1zsjx8wpj0zrxanbigpjg";
};
srcStatic = fetchurl {
url = "https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-${version}.linux-amd64.tar.gz";
sha256 = "1dg2gjmym06x8wj2xmygsww622k86cq07kbxvp8j8h17br4imj4k";
};
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;
};
}