From 3d2def38ae8977e8355ee4ed951f2ff320e9b8e3 Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Sat, 23 May 2020 12:04:18 +1200 Subject: [PATCH] grafana: 6.7.3 -> 7.0.0 This version removes PhantomJS support. Upstream also stopped vendoring dependencies, so I switched to buildGoModule. --- nixos/doc/manual/release-notes/rl-2009.xml | 8 ++++++++ pkgs/servers/monitoring/grafana/default.nix | 18 +++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index 5d2ffd262e04..41f9665a3cd5 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -452,6 +452,14 @@ systemd.services.nginx.serviceConfig.ReadWritePaths = [ "/var/www" ]; In such cases, you most likely want to create a 10-*.link file through and set both name and MAC Address / MTU there. + + + Grafana received a major update to version 7.x. A plugin is now needed for + image rendering support, and plugins must now be signed by default. More + information can be found + in the Grafana documentation. + + diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix index 7fdd9c70d9a8..23a8bdc60140 100644 --- a/pkgs/servers/monitoring/grafana/default.nix +++ b/pkgs/servers/monitoring/grafana/default.nix @@ -1,10 +1,8 @@ -{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomJsSupport ? false, phantomjs2 ? null }: +{ lib, buildGoModule, fetchurl, fetchFromGitHub }: -buildGoPackage rec { +buildGoModule rec { pname = "grafana"; - version = "6.7.3"; - - goPackagePath = "github.com/grafana/grafana"; + version = "7.0.0"; excludedPackages = [ "release_publisher" ]; @@ -12,27 +10,25 @@ buildGoPackage rec { rev = "v${version}"; owner = "grafana"; repo = "grafana"; - sha256 = "14yrfrn59r3mxbkhs7mg7nlhnvvrmq959r8w4aj6m7wgr32jj8wl"; + sha256 = "1xicqsn8qg2wwp7p3p3643vqvpp6fbzpx1x7w0mgv9l2va9px8mq"; }; srcStatic = fetchurl { url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz"; - sha256 = "17h70h6cz1bdhczjqa68kxzfm4vi95zdnqzah8hcjr7rwnx874kr"; + sha256 = "1x6b61rsflj9dbj0r9wj1wgp4lqwa1q21s3x7ws50scqhq1m3xmk"; }; + vendorSha256 = "00xvpxhnvxdf030978paywl794mlmgqzd94b64hh67946acnbjcl"; + 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 $out/share/grafana mv grafana-*/{public,conf,tools} $out/share/grafana/ - '' + lib.optionalString phantomJsSupport '' - ln -sf ${phantomjs2}/bin/phantomjs $out/share/grafana/tools/phantomjs/phantomjs ''; meta = with lib; {