This commit is contained in:
mjallen18
2025-07-18 13:21:50 -05:00
parent 996e34d075
commit 407f8ede87
14 changed files with 83 additions and 133 deletions

View File

@@ -44,43 +44,42 @@ in
"cloudflare"
"co2signal"
"color_extractor"
"esphome"
"ffmpeg"
"google_translate"
"holiday"
"homekit"
"isal"
"jellyfin"
"met"
"music_assistant"
"mqtt"
"nut"
"nextcloud"
"nws"
"ollama"
"onedrive"
"ping"
"radio_browser"
"samsungtv"
"season"
"shopping_list"
"simplefin"
"smartthings"
"subaru"
"upnp"
"vesync"
"workday"
"wyoming"
"google_translate"
"met"
"radio_browser"
"shopping_list"
"esphome"
# Recommended for fast zlib compression
# https://www.home-assistant.io/integrations/isal
"isal"
"subaru"
"vesync"
"mqtt" # Enables MQTT integration in HA
"ffmpeg" # Enables camera streams
"zha" # Enables Zigbee integration
"homekit"
"music_assistant"
"zha"
];
customComponents = with pkgs.home-assistant-custom-components; [
# nixpkgs
auth-header
localtuya
# packages
pkgs.${namespace}.ha-anycubic
pkgs.${namespace}.ha-bambulab
pkgs.${namespace}.ha-gehome
@@ -91,6 +90,7 @@ in
pkgs.${namespace}.ha-petlibro
pkgs.${namespace}.ha-wyzeapi
];
customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [
atomic-calendar-revive
bubble-card

View File

@@ -1,62 +0,0 @@
{ dream2nix, ... }:
let
hostAddress = "10.0.1.4";
localAddress = "10.0.4.2";
hassPort = 8123;
in
{
containers.homeassistant = {
autoStart = true;
privateNetwork = true;
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
];
networking = {
firewall = {
enable = true;
allowedTCPPorts = [ hassPort ];
};
# Use systemd-resolved inside the container
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
useHostResolvConf = lib.mkForce false;
};
# Create and set permissions for required directories
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;
system.stateVersion = "23.11";
};
};
networking.nat = {
forwardPorts = [
{
destination = "${localAddress}:${toString hassPort}";
sourcePort = hassPort;
}
];
};
}