Hello Nixers,
I’m trying to configure a simple bridge from an MQTT broker (embedded in a Victron GX device) to a NixOS homeserver since Home Assistant support a single MQTT broker configured and I need another to manage some Shelly Flood devices (where HA integration fails to remain connected), merging topics between the Victron broker and mine with the Shelly’s.
From the wiki I see how to configure the broker/listener part, nixos-rebuild succeed, but I can’t understand how to configure the bridge. In mosquitto terms the config is a very simple
connection bridge-hsrv-victron
address 192.168.1.50:1883
topic # both 0
but I fails to understand how to write in nix langue the same. From NixOS option mosquitto.bridges is an attribute set of (submodule)
so I understand it should be declared like
mosquitto = {
bridges = {
}; # bridges
}; # mosquitto
then I need a bridge <name>
so I suppose something like
bridges = {
"bridge-hsrv-victron" = ...
}; # bridges
or
bridges.bridge-hsrv-victron = {
}; # bridges.bridge-hsrv-victron
imaging it map to the connection
mosquitto config directive but I can’t understand the meaning of addresses.*.address
, I know I can have many bridges, but if I’m declare one, anything should be in that scope, so I’ve blindly try
addresses.victron = [
address = "192.168.1.101";
port = "1883";
]; # addresses
but nixos-rebuild fails with error: syntax error, unexpected '='
on
address = "192.168.1.101";
^
And… Well… I can’t understand the logic. Can anyone address me?