os/hosts/companion/home-assistant.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

77 lines
1.8 KiB
Nix
Raw Normal View History

2023-04-01 14:48:12 +00:00
{
self,
config,
pkgs,
...
}: {
config = {
services.mosquitto = {
enable = true;
listeners = [
{
users = {
z2m.hashedPassword = "$7$101$iZE7WOCQIaLtuoVN$M7AAB/mMmhkuXQVmu2RPoJzm744bmwxGTJwE0eoqlPAjyQHbjmOWfEuKoo9jnQCoQu2T96gS8znsUNizGgPWiQ==";
ha.hashedPassword = "$7$101$jLA9PReG5btNSvw8$O0c3UzCfcBcvqVH8kMZIwEims7p1L4o/DmOTHO9w9731ggC5SyUpJGQIDiUbv+IrTl/H0+Fz9QF/jvY0QCuxuA==";
};
}
];
};
services.udev.extraRules = ''KERNEL=="ttyS0", OWNER="zigbee2mqtt", GROUP="zigbee2mqtt"'';
services.zigbee2mqtt = {
enable = true;
settings = {
frontend = true;
permit_join = true;
homeassistant = true;
options = "-d -d";
mqtt = {
user = "z2m";
password = "!secrets.yaml mqtt_password";
};
serial = {
port = "/dev/ttyS0";
adapter = "deconz";
};
#advanced.network_key = "'!secrets.yaml network_key'";
};
};
#users.users.hass.extraGroups = [ "tty" ];
services.home-assistant = {
enable = true;
extraComponents = ["fritz" "fritzbox" "fritzbox_callmonitor" "met" "mqtt"];
config = {
homeassistant = {};
http = {
ip_ban_enabled = false;
use_x_forwarded_for = true;
trusted_proxies = [
"127.0.0.1"
"10.254.0.21"
"10.0.1.5"
"10.0.1.6"
"172.16.0.0/12"
];
};
energy = {};
frontend = {};
history = {};
map = {};
my = {};
mobile_app = {};
network = {};
notify = {};
person = {};
ssdp = {};
sun = {};
system_health = {};
zeroconf = {};
};
};
};
}