forked from CCCHH/nix-infra
Add mqtt server (mosquitto)
The config was based on the exsisting mosquitto setup.
This commit is contained in:
parent
8a2d406d4e
commit
b30952a049
5 changed files with 81 additions and 0 deletions
33
config/hosts/mqtt/mosquitto.nix
Normal file
33
config/hosts/mqtt/mosquitto.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
# 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 ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue