nixos/system/services/home-assistant/default.nix

69 lines
1.7 KiB
Nix

{ config, pkgs, ... }:
{
services.home-assistant = {
enable = true;
extraComponents = [
# Components required to complete the onboarding
"analytics"
"google_translate"
"met"
"radio_browser"
"shopping_list"
# Recommended for fast zlib compression
# https://www.home-assistant.io/integrations/isal
"isal"
# Extra integrations
"apple_tv"
"bluetooth"
"ffmpeg" # Tapo
"mobile_app"
"nanoleaf"
"onvif" # Tapo
"proximity"
"prusalink"
"sonos"
"syncthing"
"tado"
"tplink_tapo"
];
customComponents =
let
hassPython = config.services.home-assistant.package.python;
in
(with pkgs.home-assistant-custom-components; [
(dirigera_platform.override {
dirigera = (pkgs.python312.pkgs.dirigera.overrideAttrs (final: prev: { doCheck = false; }));
})
])
++ [ (hassPython.pkgs.callPackage ./customComponents/tapo_control.nix { }) ];
config = {
# Includes dependencies for a basic setup
# https://www.home-assistant.io/integrations/default_config/
default_config = { };
frontend.themes = "!include_dir_merge_named themes";
automation = "!include automations.yaml";
script = "!include scripts.yaml";
scene = "!include scenes.yaml";
http = {
use_x_forwarded_for = true;
trusted_proxies = [
"127.0.0.1"
"::1"
];
};
};
};
networking.firewall = {
allowedTCPPorts = [
1400
1443
];
allowedUDPPorts = [
1400
1443
5353
];
};
services.caddy.virtualHosts."home.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:8123";
}