nixos-config/machines/raspite/hass.nix

55 lines
1.1 KiB
Nix
Raw Normal View History

2024-08-25 09:45:58 +00:00
{ config, pkgs, ... }:
{
2024-06-11 10:24:22 +00:00
services.home-assistant = {
enable = true;
openFirewall = false;
config = {
2024-08-25 09:45:58 +00:00
default_config = { };
2024-06-11 10:24:22 +00:00
http = {
2024-10-20 07:14:01 +00:00
server_host = "127.0.0.1";
use_x_forwarded_for = true;
trusted_proxies = [ "127.0.0.1" ];
2024-06-11 10:24:22 +00:00
};
};
2024-10-20 07:14:01 +00:00
extraPackages =
python3Packages: with python3Packages; [
# speed up aiohttp
isal
zlib-ng
];
2024-06-11 10:24:22 +00:00
};
services.esphome = {
enable = true;
openFirewall = false;
};
users.groups.dialout.members = config.users.groups.wheel.members;
2024-10-20 07:14:01 +00:00
services.mosquitto = {
enable = true;
};
2024-06-11 10:24:22 +00:00
2024-10-20 07:14:01 +00:00
services.zigbee2mqtt = {
enable = true;
settings = {
home-assistant = config.services.home-assistant.enable;
permit_join = true;
serial = {
port = "/dev/ttyUSB0";
};
};
};
networking.firewall.allowedTCPPorts = [ 8443 ];
2024-06-11 10:24:22 +00:00
services.caddy = {
2024-08-25 09:45:58 +00:00
enable = true;
2024-06-11 10:24:22 +00:00
virtualHosts = {
2024-10-20 07:14:01 +00:00
"raspite.coho-tet.ts.net".extraConfig = ''
reverse_proxy ${config.services.home-assistant.config.http.server_host}:${toString config.services.home-assistant.config.http.server_port}
2024-06-11 10:24:22 +00:00
'';
};
};
}