From 3081f16b6417e68f5c0d10df735b61eff19853fe Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sat, 22 Nov 2025 18:25:49 +0100 Subject: [PATCH] grafana: Use `lib.mkIf` instead of `lib.optional` --- modules/system/web-services/grafana.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/system/web-services/grafana.nix b/modules/system/web-services/grafana.nix index 24f066d..ff63267 100644 --- a/modules/system/web-services/grafana.nix +++ b/modules/system/web-services/grafana.nix @@ -87,8 +87,8 @@ in datasources.settings = { prune = true; - datasources = lib.concatLists [ - (lib.optional cfg.datasources.prometheus.enable { + datasources = [ + (lib.mkIf cfg.datasources.prometheus.enable { name = "Prometheus"; type = "prometheus"; inherit (cfg.datasources.prometheus) url; @@ -98,13 +98,13 @@ in prometheusVersion = "2.50.0"; }; }) - (lib.optional cfg.datasources.victoriametrics.enable { + (lib.mkIf cfg.datasources.victoriametrics.enable { name = "VictoriaMetrics"; type = "victoriametrics-metrics-datasource"; inherit (cfg.datasources.victoriametrics) url; isDefault = false; }) - (lib.optional cfg.datasources.victorialogs.enable { + (lib.mkIf cfg.datasources.victorialogs.enable { name = "VictoriaLogs"; type = "victoriametrics-logs-datasource"; inherit (cfg.datasources.victorialogs) url;