prometheus: Adds an option for web.config.file which can specity settings including authorization.

This commit is contained in:
Shawn8901 2022-11-20 00:00:43 +01:00
parent 470247d433
commit 6e530b9eda

View file

@ -71,7 +71,8 @@ let
"--web.listen-address=${cfg.listenAddress}:${builtins.toString cfg.port}"
"--alertmanager.notification-queue-capacity=${toString cfg.alertmanagerNotificationQueueCapacity}"
] ++ optional (cfg.webExternalUrl != null) "--web.external-url=${cfg.webExternalUrl}"
++ optional (cfg.retentionTime != null) "--storage.tsdb.retention.time=${cfg.retentionTime}";
++ optional (cfg.retentionTime != null) "--storage.tsdb.retention.time=${cfg.retentionTime}"
++ optional (cfg.webConfigFile != null) "--web.config.file=${cfg.webConfigFile}";
filterValidPrometheus = filterAttrsListRecursive (n: v: !(n == "_module" || v == null));
filterAttrsListRecursive = pred: x:
@ -1717,6 +1718,15 @@ in
'';
};
webConfigFile = mkOption {
type = types.nullOr types.path;
default = null;
description = lib.mdDoc ''
Specifies which file should be used as web.config.file and be passed on startup.
See https://prometheus.io/docs/prometheus/latest/configuration/https/ for valid options.
'';
};
checkConfig = mkOption {
type = with types; either bool (enum [ "syntax-only" ]);
default = true;