From df8958435e1fd0c6d55394e95d3d3d2e0edca474 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Fri, 13 May 2016 02:28:24 +0200 Subject: [PATCH] grafana: 2.6.0 -> 3.0.1 (#15395) * grafana: 2.6.0 -> 3.0.1 * grafana module: Fix anonymous auth & add analytics config --- nixos/modules/services/monitoring/grafana.nix | 14 ++++++++++++-- pkgs/servers/monitoring/grafana/default.nix | 11 +++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 5c6f063b1493..defbd9289dcd 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -36,7 +36,9 @@ let USERS_AUTO_ASSIGN_ORG = b2s cfg.users.autoAssignOrg; USERS_AUTO_ASSIGN_ORG_ROLE = cfg.users.autoAssignOrgRole; - AUTH_ANONYMOUS_ENABLE = b2s cfg.auth.anonymous.enable; + AUTH_ANONYMOUS_ENABLED = b2s cfg.auth.anonymous.enable; + + ANALYTICS_REPORTING_ENABLED = b2s cfg.analytics.reporting.enable; } // cfg.extraOptions; in { @@ -196,6 +198,14 @@ in { }; }; + analytics.reporting = { + enable = mkOption { + description = "Whether to allow anonymous usage reporting to stats.grafana.net"; + default = true; + type = types.bool; + }; + }; + extraOptions = mkOption { description = '' Extra configuration options passed as env variables as specified in @@ -218,7 +228,7 @@ in { after = ["networking.target"]; environment = mapAttrs' (n: v: nameValuePair "GF_${n}" (toString v)) envOptions; serviceConfig = { - ExecStart = "${cfg.package}/bin/grafana -homepath ${cfg.dataDir}"; + ExecStart = "${cfg.package}/bin/grafana-server -homepath ${cfg.dataDir}"; WorkingDirectory = cfg.dataDir; User = "grafana"; }; diff --git a/pkgs/servers/monitoring/grafana/default.nix b/pkgs/servers/monitoring/grafana/default.nix index e9ba8aa7aa83..55ef139624c4 100644 --- a/pkgs/servers/monitoring/grafana/default.nix +++ b/pkgs/servers/monitoring/grafana/default.nix @@ -1,21 +1,20 @@ { lib, goPackages, fetchurl, fetchFromGitHub }: goPackages.buildGoPackage rec { - version = "2.6.0"; + version = "3.0.1"; name = "grafana-v${version}"; goPackagePath = "github.com/grafana/grafana"; - subPackages = [ "./" ]; src = fetchFromGitHub { rev = "v${version}"; owner = "grafana"; repo = "grafana"; - sha256 = "160jarvmfvrzpk8agbl44761qz4rw273d59jg6kzd0ghls03wipr"; + sha256 = "1zykgf8xq7m040d4yljcbz23gh8ppaqnxj50ncj1cjyi5k88i3i9"; }; srcStatic = fetchurl { - url = "https://grafanarel.s3.amazonaws.com/builds/grafana-${version}.linux-x64.tar.gz"; - sha256 = "1i4aw5jvamgqfaanxlh3l83sn8xx10wpihciihvf7s3846s623ab"; + url = "https://grafanarel.s3.amazonaws.com/builds/grafana-${version}-.linux-x64.tar.gz"; + sha256 = "14wq2cbf4djnwbbyfbhnwmwqpfh5g4yp1dckg5zzf2109ymkjrqd"; }; preBuild = "export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace"; @@ -29,7 +28,7 @@ goPackages.buildGoPackage rec { description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB"; license = licenses.asl20; homepage = http://grafana.org/; - maintainers = with maintainers; [ offline ]; + maintainers = with maintainers; [ offline fpletz ]; platforms = platforms.linux; }; }