mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
grafana: Use lib.mkIf instead of lib.optional
This commit is contained in:
parent
68031a4cc4
commit
3081f16b64
1 changed files with 4 additions and 4 deletions
|
|
@ -87,8 +87,8 @@ in
|
||||||
|
|
||||||
datasources.settings = {
|
datasources.settings = {
|
||||||
prune = true;
|
prune = true;
|
||||||
datasources = lib.concatLists [
|
datasources = [
|
||||||
(lib.optional cfg.datasources.prometheus.enable {
|
(lib.mkIf cfg.datasources.prometheus.enable {
|
||||||
name = "Prometheus";
|
name = "Prometheus";
|
||||||
type = "prometheus";
|
type = "prometheus";
|
||||||
inherit (cfg.datasources.prometheus) url;
|
inherit (cfg.datasources.prometheus) url;
|
||||||
|
|
@ -98,13 +98,13 @@ in
|
||||||
prometheusVersion = "2.50.0";
|
prometheusVersion = "2.50.0";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(lib.optional cfg.datasources.victoriametrics.enable {
|
(lib.mkIf cfg.datasources.victoriametrics.enable {
|
||||||
name = "VictoriaMetrics";
|
name = "VictoriaMetrics";
|
||||||
type = "victoriametrics-metrics-datasource";
|
type = "victoriametrics-metrics-datasource";
|
||||||
inherit (cfg.datasources.victoriametrics) url;
|
inherit (cfg.datasources.victoriametrics) url;
|
||||||
isDefault = false;
|
isDefault = false;
|
||||||
})
|
})
|
||||||
(lib.optional cfg.datasources.victorialogs.enable {
|
(lib.mkIf cfg.datasources.victorialogs.enable {
|
||||||
name = "VictoriaLogs";
|
name = "VictoriaLogs";
|
||||||
type = "victoriametrics-logs-datasource";
|
type = "victoriametrics-logs-datasource";
|
||||||
inherit (cfg.datasources.victorialogs) url;
|
inherit (cfg.datasources.victorialogs) url;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue