MQTT Brocker
This commit is contained in:
parent
dec8f0d43d
commit
bb99bc313d
1 changed files with 32 additions and 0 deletions
32
hosts/hackens-org/mosquitto.nix
Normal file
32
hosts/hackens-org/mosquitto.nix
Normal 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 ];
|
||||
}
|
Loading…
Reference in a new issue