Skip to content

Commit 0f769e6

Browse files
committedFeb 13, 2017
nixos/grafana: Don't print password warning if no password has been set
(cherry picked from commit cda4a4d)
1 parent 2da8a5d commit 0f769e6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎nixos/modules/services/monitoring/grafana.nix

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, lib, pkgs, ... }:
1+
{ options, config, lib, pkgs, ... }:
22

33
with lib;
44

@@ -232,9 +232,10 @@ in {
232232
};
233233

234234
config = mkIf cfg.enable {
235-
warnings = [
236-
"Grafana passwords will be stored as plaintext in the Nix store!"
237-
];
235+
warnings = optional (
236+
cfg.database.password != options.services.grafana.database.password.default ||
237+
cfg.security.adminPassword != options.services.grafana.security.adminPassword.default
238+
) "Grafana passwords will be stored as plaintext in the Nix store!";
238239

239240
environment.systemPackages = [ cfg.package ];
240241

0 commit comments

Comments
 (0)
Please sign in to comment.