nixos/mosquitto: fix attribute path display in assertions

This commit is contained in:
pennae 2022-05-14 08:01:30 +02:00
parent 2145dbc4fc
commit c1115d37ff

View File

@ -296,7 +296,7 @@ let
};
listenerAsserts = prefix: listener:
assertKeysValid prefix freeformListenerKeys listener.settings
assertKeysValid "${prefix}.settings" freeformListenerKeys listener.settings
++ userAsserts prefix listener.users
++ imap0
(i: v: authAsserts "${prefix}.authPlugins.${toString i}" v)
@ -398,7 +398,7 @@ let
};
bridgeAsserts = prefix: bridge:
assertKeysValid prefix freeformBridgeKeys bridge.settings
assertKeysValid "${prefix}.settings" freeformBridgeKeys bridge.settings
++ [ {
assertion = length bridge.addresses > 0;
message = "Bridge ${prefix} needs remote broker addresses";
@ -527,7 +527,7 @@ let
globalAsserts = prefix: cfg:
flatten [
(assertKeysValid prefix freeformGlobalKeys cfg.settings)
(assertKeysValid "${prefix}.settings" freeformGlobalKeys cfg.settings)
(imap0 (n: l: listenerAsserts "${prefix}.listener.${toString n}" l) cfg.listeners)
(mapAttrsToList (n: b: bridgeAsserts "${prefix}.bridge.${n}" b) cfg.bridges)
];