nix-infra/config/hosts/mqtt/mosquitto.nix
christian b30952a049
Add mqtt server (mosquitto)
The config was based on the exsisting mosquitto setup.
2024-06-11 23:03:57 +02:00

33 lines
926 B
Nix

# Sources for this configuration:
# - https://search.nixos.org/options?sort=relevance&type=packages&query=services.mosquitto
# - https://mosquitto.org/man/mosquitto-conf-5.html
# - https://winkekatze24.de
{ ... }:
{
services.mosquitto = {
enable = true;
persistence = true;
# set config for all listeners
listeners = [ {
settings.allow_anonymous = true;
omitPasswordAuth = true;
acl = ["topic readwrite #"];
} ];
bridges.winkekatz = {
addresses = [
{ address = "mqtt.winkekatze24.de"; }
];
topics = [
"winkekatze/allcats/eye/set in 2"
"winkekatze/allcats in 2"
"+/status out 2 winkekatze/ \"\""
"+/connected out 2 winkekatze/ \"\""
];
};
};
networking.firewall.allowedTCPPorts = [ 1883 ];
}