From 45e12d29068a22612fd12b453f4674bdbfbef17c Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 16 Feb 2025 10:31:55 +0000 Subject: [PATCH] Start converting home-assistant from container to native install --- system/services/home-assistant.nix | 57 +++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/system/services/home-assistant.nix b/system/services/home-assistant.nix index ff226733..2190f372 100644 --- a/system/services/home-assistant.nix +++ b/system/services/home-assistant.nix @@ -1,17 +1,48 @@ -{ config, ... }: +{ config, pkgs, ... }: { - virtualisation.oci-containers = { - backend = "podman"; - containers.homeassistant = { - volumes = [ - "/var/lib/home-assistant:/config" - "/run/dbus:/run/dbus:ro" - "/var/lib/syncthing/Music:/music" - "/tmp:/.dockerenv" # TEMP FIX FOR CONTAINER CHECKS - ]; - environment.TZ = config.time.timeZone; - image = "ghcr.io/home-assistant/home-assistant@sha256:db0f344d5126bfedd7bf18e0bfb8249a9a5e6785e2f6cb3728edbd393fff1981"; # 2024-12-20T10:54:13.805911135Z - extraOptions = [ "--network=host" ]; + 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" + "mobile_app" + "nanoleaf" + "proximity" + "prusalink" + "sonos" + "syncthing" + "tplink_tapo" + ]; + customComponents = with pkgs.home-assistant-custom-components; [ dirigera_platform ]; + 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" + ]; + }; + homeassistant = { + inherit (config.location) latitude longitude; + media_dirs.music = "/var/lib/syncthing/Music"; + }; }; }; networking.firewall = {