From 15bd9a684bc6dd298ef039e8fcb5f11b9c13ca4a Mon Sep 17 00:00:00 2001 From: foxora Date: Fri, 20 Feb 2026 01:42:25 +0000 Subject: [PATCH] make home assistant more reproducible and work better --- vms/home-assistant/default.nix | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/vms/home-assistant/default.nix b/vms/home-assistant/default.nix index ef3ad3b..17ad40c 100644 --- a/vms/home-assistant/default.nix +++ b/vms/home-assistant/default.nix @@ -2,10 +2,39 @@ { services.home-assistant = { enable = true; - configDir = "/var/lib/microvms/home-assistant"; + configDir = "/var/lib/hass"; + # disables config generation, i don't wanna configure home assistant # through nix at the moment config = null; + + extraComponents = [ + "esphome" + "met" + "radio_browser" + ]; + + extraPackages = python3Packages: with python3Packages; [ + getmac + ]; + }; + + systemd.tmpfiles.rules = [ + # configures the config directory to be mounted + # correclty with the right permissions + "z /var/lib/hass 0755 hass hass -" + "z /var/lib/hass/lost+found 0755 hass hass -" + ]; + + networking = { + nftables.enable = true; + + firewall = { + enable = true; + allowedTCPPorts = [ + 8123 + ]; + }; }; users.users.nixos = {