MQTT Brocker

This commit is contained in:
sinavir 2022-04-10 17:56:04 +02:00
parent dec8f0d43d
commit bb99bc313d

View file

@ -0,0 +1,32 @@
{ ... }:
let
port = 1883;
in
{
services.mosquitto = {
enable = true;
logType = [ "all" ];
listeners = [
{
address = "0.0.0.0";
port = port;
acl = [
"topic read #"
"topic deny $SYS/#"
];
settings = {
allow_anonymous = true;
};
users.admin = {
acl = [ "readwrite #" "readwrite $SYS/#" ];
hashedPassword = "$7$101$7Jd6gbsa3mSmsw4o$9QytXhPe8b0ISWj6NdEzcdYOnIgWsjwKUOQq8GIgw3e5wLsoIutUr/l+6zNABJpfb0dHipxrDMCNQ2K4mBh2oQ==";
};
users.maurice = {
acl = [ "readwrite #" "read $SYS/#" ];
hashedPassword = "$7$101$l0ZJJnnxGFr1tEQi$drqX1AHzXyqsbhhx87jszJW4IgTIBbr3I57+rrmsgldeWNLzBJikW5BwKGHnj9K5TwEBMrdOf5v0wnlbln/Q0Q==";
};
}
];
};
networking.firewall.allowedTCPPorts = [ port ];
}