@@ -627,6 +627,21 @@ in {
627627 };
628628
629629 config = mkIf cfg.enable {
630+ assertions = [
631+ ( let
632+ legacy = builtins.match "(.*):(.*)" cfg.listenAddress;
633+ in {
634+ assertion = legacy == null;
635+ message = ''
636+ Do not specify the port for Prometheus to listen on in the
637+ listenAddress option; use the port option instead:
638+ services.prometheus.listenAddress = ${builtins.elemAt legacy 0};
639+ services.prometheus.port = ${builtins.elemAt legacy 1};
640+ '';
641+ }
642+ )
643+ ];
644+
630645 users.groups.prometheus.gid = config.ids.gids.prometheus;
631646 users.users.prometheus = {
632647 description = "Prometheus daemon user";