nixos/grafana: Don't print password warning if no password has been set

This commit is contained in:
Rickard Nilsson 2017-02-13 23:11:40 +01:00
parent 46904e9c3a
commit cda4a4dcfc

View File

@ -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 ];