1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 23:00:39 +02:00
oddlama_nix-config/hosts/sausebiene/mosquitto.nix
2025-04-27 10:46:11 +02:00

41 lines
1,018 B
Nix

{ config, ... }:
{
age.secrets.mosquitto-pw-home-assistant = {
mode = "440";
owner = "hass";
group = "mosquitto";
generator.script = "alnum";
};
age.secrets.mosquitto-pw-garage-door = {
mode = "440";
owner = "hass";
group = "mosquitto";
generator.script = "alnum";
};
services.mosquitto = {
enable = true;
persistence = true;
listeners = [
{
acl = [ "pattern readwrite #" ];
users = {
# zigbee2mqtt = {
# passwordFile = config.age.secrets.mosquitto-pw-zigbee2mqtt.path;
# acl = [ "readwrite #" ];
# };
home_assistant = {
passwordFile = config.age.secrets.mosquitto-pw-home-assistant.path;
acl = [ "readwrite #" ];
};
garage_door_sensor = {
passwordFile = config.age.secrets.mosquitto-pw-garage-door.path;
acl = [ "readwrite #" ];
};
};
settings.allow_anonymous = false;
}
];
};
}