ma ham/mqtt: convert to new mosquitto configuration

This commit is contained in:
makefu 2021-12-04 20:10:36 +01:00
parent 2d3a292ea0
commit 652298427a
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225

View File

@ -1,11 +1,16 @@
{ pkgs, config, ... }:
{
environment.systemPackages = [ pkgs.mosquitto ];
# port open via trusted interface
services.mosquitto = {
enable = true;
host = "0.0.0.0";
allowAnonymous = false;
persistence = false;
settings.max_keepalive = 60;
listeners = [
{
port = 1883;
omitPasswordAuth = true;
checkPasswords = true;
# see <host>/mosquitto
users.sensor = {
hashedPassword = "$6$2DXU7W1bvqXPqxkF$vtdz5KTd/T09hmoc9LjgEGFjvpwQbQth6vlVcr5hJNLgcBHv4U03YCKC8TKXbmQAa8xiJ76xJIg25kcL+KI3tg==";
acl = [ "topic readwrite #" ];
@ -18,7 +23,10 @@
hashedPassword = "$6$j4H7KXD/YZgvgNmL$8e9sUKRXowDqJLOVgzCdDrvDE3+4dGgU6AngfAeN/rleGOgaMhee2Mbg2KS5TC1TOW3tYbk9NhjLYtjBgfRkoA==";
acl = [ "topic read #" ];
};
settings = {
allow_anonymous = false;
};
}
];
};
environment.systemPackages = [ pkgs.mosquitto ];
# port open via trusted interface
}