diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index b9e4015c238..97806d5d83e 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 ];