about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring
diff options
context:
space:
mode:
authorRickard Nilsson <rickynils@gmail.com>2017-02-13 23:11:40 +0100
committerRickard Nilsson <rickynils@gmail.com>2017-02-13 23:11:40 +0100
commitcda4a4dcfce277b93b87be49945ed44f61483ee1 (patch)
tree445df2ce9e28f65b4d08082392e436ab1dace724 /nixos/modules/services/monitoring
parent46904e9c3aec7f886493de7215f51a3c8e71c6c1 (diff)
downloadnixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.tar
nixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.tar.gz
nixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.tar.bz2
nixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.tar.lz
nixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.tar.xz
nixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.tar.zst
nixlib-cda4a4dcfce277b93b87be49945ed44f61483ee1.zip
nixos/grafana: Don't print password warning if no password has been set
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r--nixos/modules/services/monitoring/grafana.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix
index b9e4015c2380..97806d5d83eb 100644
--- a/nixos/modules/services/monitoring/grafana.nix
+++ b/nixos/modules/services/monitoring/grafana.nix
@@ -1,4 +1,4 @@
-{ config, lib, pkgs, ... }:
+{ options, config, lib, pkgs, ... }:
 
 with lib;
 
@@ -232,9 +232,10 @@ in {
   };
 
   config = mkIf cfg.enable {
-    warnings = [
-      "Grafana passwords will be stored as plaintext in the Nix store!"
-    ];
+    warnings = optional (
+      cfg.database.password != options.services.grafana.database.password.default ||
+      cfg.security.adminPassword != options.services.grafana.security.adminPassword.default
+    ) "Grafana passwords will be stored as plaintext in the Nix store!";
 
     environment.systemPackages = [ cfg.package ];