config upd

This commit is contained in:
mjallen18
2025-07-16 12:46:52 -05:00
parent 6c3de9beb4
commit cdcd102d8c
7 changed files with 213 additions and 32 deletions

View File

@@ -23,7 +23,7 @@ let
src = pkgs.fetchFromGitHub {
owner = owner;
repo = domain;
repo = "ha_gehome";
rev = version;
hash = "sha256-NlUkM70yvBeC5s7S5BkNxIC2GztfEq8xYrQZr4pkaGU=";
};

View File

@@ -1,8 +1,8 @@
{ dream2nix, ... }:
let
hostAddress = "10.0.1.3";
localAddress = "10.0.2.3";
hassPort = 8192;
hostAddress = "10.0.1.4";
localAddress = "10.0.4.2";
hassPort = 8123;
in
{
containers.homeassistant = {
@@ -11,13 +11,23 @@ in
hostAddress = hostAddress;
localAddress = localAddress;
bindMounts = {
"/var/lib/homeassistant" = {
hostPath = "/var/lib/homeassistant";
isReadOnly = false;
};
USB0 = {
hostPath = "/dev/ttyUSB0";
mountPoint = "/dev/ttyUSB0";
isReadOnly = false;
};
};
config = { lib, ... }:
{
imports = [
./homeassistant.nix
({ ... }: { _module.args.dream2nix = dream2nix; })
./homeassistant.nix
];
# inherit dream2nix;
networking = {
firewall = {
@@ -30,13 +40,10 @@ in
};
# Create and set permissions for required directories
system.activationScripts.gitea-dirs = ''
mkdir -p /var/lib/gitea
chown -R gitea:gitea /var/lib/gitea
chmod -R 775 /var/lib/gitea
mkdir -p /run/secrets/jallen-nas
chown -R gitea:gitea /run/secrets/jallen-nas
chmod -R 775 /run/secrets/jallen-nas
system.activationScripts.hass-dirs = ''
mkdir -p /var/lib/homeassistant
chown -R homeassistant:homeassistant /var/lib/homeassistat
chmod -R 775 /var/lib/homeassistant
'';
services.resolved.enable = true;
@@ -52,4 +59,4 @@ in
}
];
};
}
}

View File

@@ -24,14 +24,44 @@ in
services.home-assistant = {
enable = true;
openFirewall = true;
configDir = "/var/lib/homeassistant";
configWritable = true; # todo
extraComponents = [
# Components required to complete the onboarding
"adguard"
"apple_tv"
"analytics"
"bluetooth"
"bluetooth_adapters"
"bluetooth_le_tracker"
"bluetooth_tracker"
"brother"
"caldav"
"calendar"
"cloudflare"
"co2signal"
"color_extractor"
"holiday"
"jellyfin"
"music_assistant"
"nut"
"nextcloud"
"nws"
"ollama"
"onedrive"
"ping"
"samsungtv"
"season"
"simplefin"
"smartthings"
"upnp"
"workday"
"wyoming"
"google_translate"
"met"
"radio_browser"
"shopping_list"
"esphome"
# Recommended for fast zlib compression
# https://www.home-assistant.io/integrations/isal
"isal"
@@ -147,6 +177,18 @@ in
python-roborock
python-steam
apple-weatherkit
samsungctl
samsungtvws
aiohomekit
icmplib
aioelectricitymaps
wyoming
pysmartthings
wakeonlan
ephem
];
config = {
@@ -160,15 +202,17 @@ in
themes = "!include_dir_merge_named themes";
};
"automation ui" = "!include /etc/nixos/hosts/homeassistant/automations.yaml";
"scene ui" = "!include /etc/nixos/hosts/homeassistant/scenes.yaml";
"script ui" = "!include /etc/nixos/hosts/homeassistant/scripts.yaml";
"automation ui" = "!include automations.yaml";
"scene ui" = "!include scenes.yaml";
"script ui" = "!include scripts.yaml";
http = {
use_x_forwarded_for = true;
trusted_proxies = [
"172.30.33.0/24"
"10.0.1.3"
"10.0.1.4"
"10.0.4.2"
"10.0.1.18"
"10.0.1.0/24"
];
};
@@ -195,13 +239,6 @@ in
# This bypasses the component validation and places it directly in HA's data directory
system.activationScripts.installCustomComponents = ''
mkdir -p ${config.services.home-assistant.configDir}/custom_components
ln -sf /etc/nixos/hosts/homeassistant/automations.yaml ${config.services.home-assistant.configDir}/automations.yaml
ln -sf /etc/nixos/hosts/homeassistant/scenes.yaml ${config.services.home-assistant.configDir}/scenes.yaml
ln -sf /etc/nixos/hosts/homeassistant/scripts.yaml ${config.services.home-assistant.configDir}/scripts.yaml
chown -R hass:hass ${config.services.home-assistant.configDir}
chmod -R 750 ${config.services.home-assistant.configDir}
'';