Use lib.concatLists instead of ++ when convenient

This commit is contained in:
SebastianStork 2025-10-12 23:20:09 +02:00
parent 8807d38b57
commit 90302f4c2b
3 changed files with 10 additions and 7 deletions

View file

@ -86,7 +86,7 @@ in
datasources.settings = {
prune = true;
datasources =
datasources = lib.concatLists [
(lib.optional cfg.datasources.prometheus.enable {
name = "Prometheus";
type = "prometheus";
@ -97,18 +97,19 @@ in
prometheusVersion = "2.50.0";
};
})
++ (lib.optional cfg.datasources.victoriametrics.enable {
(lib.optional cfg.datasources.victoriametrics.enable {
name = "VictoriaMetrics";
type = "victoriametrics-metrics-datasource";
inherit (cfg.datasources.victoriametrics) url;
isDefault = false;
})
++ (lib.optional cfg.datasources.victorialogs.enable {
(lib.optional cfg.datasources.victorialogs.enable {
name = "VictoriaLogs";
type = "victoriametrics-logs-datasource";
inherit (cfg.datasources.victorialogs) url;
isDefault = false;
});
})
];
};
};

View file

@ -29,9 +29,10 @@ in
};
config = lib.mkIf cfg.enable {
warnings =
lib.optional (lib.pathExists "${modulesPath}/services/misc/memos.nix") "TODO: Use memos module from stable nixpkgs"
++ lib.optional (lib.versionAtLeast lib.version "25.11") "TODO: Use memos package from stable nixpkgs";
warnings = lib.concatLists [
(lib.optional (lib.pathExists "${modulesPath}/services/misc/memos.nix") "TODO: Use memos module from stable nixpkgs")
(lib.optional (lib.versionAtLeast lib.version "25.11") "TODO: Use memos package from stable nixpkgs")
];
meta = {
domains.list = [ cfg.domain ];