From 9f0014b6f209f54b4025a001555dd8e1b1d9ef4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Netix=20=28Espinet=20Franc=CC=A7ois=29?= Date: Thu, 20 Feb 2020 22:05:20 +0100 Subject: [PATCH] grafana: made phantomjs2 optional On servers especially, phantomjs2 pulls graphical dependencies which is unecessary. This pathes enable the package to be linked/installed without phantomjs2. Phantomjs2 is disabled by default since it has been deprecated in grafana https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/ --- nixos/doc/manual/release-notes/rl-2009.xml | 13 ++++++++++++- pkgs/servers/monitoring/grafana/default.nix | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index d07b7cf49c39..2c407a5130c8 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -59,7 +59,18 @@ - + + Grafana is now built without support for phantomjs by default. Phantomjs support has been + deprecated in Grafana + and the phantomjs project is + currently unmaintained. + It can still be enabled by providing phantomJsSupport = true to the package instanciation: +{ + services.grafana.package = pkgs.grafana.overrideAttrs (oldAttrs: rec { + phantomJsSupport = false; + }); +} + diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix index cbb13074afc8..a4a4796a8cdf 100644 --- a/pkgs/servers/monitoring/grafana/default.nix +++ b/pkgs/servers/monitoring/grafana/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }: +{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomJsSupport ? false, phantomjs2 ? null }: buildGoPackage rec { pname = "grafana"; @@ -31,6 +31,7 @@ buildGoPackage rec { tar -xvf $srcStatic mkdir -p $bin/share/grafana mv grafana-*/{public,conf,tools} $bin/share/grafana/ + '' + lib.optionalString phantomJsSupport '' ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/tools/phantomjs/phantomjs '';