Start converting home-assistant from container to native install

This commit is contained in:
Evie Litherland-Smith 2025-02-16 10:31:55 +00:00
parent 64372f0f6b
commit 45e12d2906

View file

@ -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 = {