prometheus: Add assert for legacy listenAddress
This commit is contained in:
parent
5d2a465add
commit
e1d80de838
@ -627,6 +627,21 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
( let
|
||||||
|
legacy = builtins.match "(.*):(.*)" cfg.listenAddress;
|
||||||
|
in {
|
||||||
|
assertion = legacy == null;
|
||||||
|
message = ''
|
||||||
|
Do not specify the port for Prometheus to listen on in the
|
||||||
|
listenAddress option; use the port option instead:
|
||||||
|
services.prometheus.listenAddress = ${builtins.elemAt legacy 0};
|
||||||
|
services.prometheus.port = ${builtins.elemAt legacy 1};
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
users.groups.prometheus.gid = config.ids.gids.prometheus;
|
users.groups.prometheus.gid = config.ids.gids.prometheus;
|
||||||
users.users.prometheus = {
|
users.users.prometheus = {
|
||||||
description = "Prometheus daemon user";
|
description = "Prometheus daemon user";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user