1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

feat: configure homeassistant and esphome on new machine

This commit is contained in:
oddlama 2025-01-26 01:43:01 +01:00
parent 0ff0828ca9
commit 3d37e2959f
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
52 changed files with 403 additions and 672 deletions

View file

@ -0,0 +1,42 @@
{ config, ... }:
{
age.secrets.mosquitto-pw-home-assistant = {
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 #" ];
};
};
settings.allow_anonymous = false;
}
];
};
networking.nftables.firewall.rules = {
# Allow devices and iot VLANs to access the MQTT server
access-mqtt = {
from = [
"vlan-devices"
"vlan-iot"
];
to = [ "local" ];
allowedTCPPorts = [ 1883 ];
};
};
}