diff options
author | Franz Pletz <fpletz@fnordicwalking.de> | 2016-07-15 15:26:31 +0200 |
---|---|---|
committer | Franz Pletz <fpletz@fnordicwalking.de> | 2016-07-19 00:18:12 +0200 |
commit | febcd39afa6dff017290d3c56b7c545c8e05659b (patch) | |
tree | 2274bd37f8f4df30b999abec6591ad76fc5af8f2 /nixos/modules/services/monitoring/grafana.nix | |
parent | 07fe6fa90e3ba01c415b3ff776c5399744845645 (diff) | |
download | nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.tar nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.tar.gz nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.tar.bz2 nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.tar.lz nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.tar.xz nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.tar.zst nixpkgs-febcd39afa6dff017290d3c56b7c545c8e05659b.zip |
nixos/grafana: set plugins path, fix image generation
Also add options to configure which organization should have anonymous access.
Diffstat (limited to 'nixos/modules/services/monitoring/grafana.nix')
-rw-r--r-- | nixos/modules/services/monitoring/grafana.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 0b7f3ce0a29..b9e4015c238 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -9,6 +9,7 @@ let envOptions = { PATHS_DATA = cfg.dataDir; + PATHS_PLUGINS = "${cfg.dataDir}/plugins"; PATHS_LOGS = "${cfg.dataDir}/log"; SERVER_PROTOCOL = cfg.protocol; @@ -37,6 +38,8 @@ let USERS_AUTO_ASSIGN_ORG_ROLE = cfg.users.autoAssignOrgRole; AUTH_ANONYMOUS_ENABLED = b2s cfg.auth.anonymous.enable; + AUTH_ANONYMOUS_ORG_NAME = cfg.auth.anonymous.org_name; + AUTH_ANONYMOUS_ORG_ROLE = cfg.auth.anonymous.org_role; ANALYTICS_REPORTING_ENABLED = b2s cfg.analytics.reporting.enable; } // cfg.extraOptions; @@ -196,6 +199,17 @@ in { default = false; type = types.bool; }; + org_name = mkOption { + description = "Which organization to allow anonymous access to"; + default = "Main Org."; + type = types.str; + }; + org_role = mkOption { + description = "Which role anonymous users have in the organization"; + default = "Viewer"; + type = types.str; + }; + }; analytics.reporting = { @@ -222,6 +236,8 @@ in { "Grafana passwords will be stored as plaintext in the Nix store!" ]; + environment.systemPackages = [ cfg.package ]; + systemd.services.grafana = { description = "Grafana Service Daemon"; wantedBy = ["multi-user.target"]; @@ -234,6 +250,7 @@ in { }; preStart = '' ln -fs ${cfg.package}/share/grafana/conf ${cfg.dataDir} + ln -fs ${cfg.package}/share/grafana/vendor ${cfg.dataDir} ''; }; |