From e36dc1b5313ac0832ffa46174cb21b48f75da2ba Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sat, 26 Jul 2025 12:39:50 +0100 Subject: [PATCH] chore(homeassistant): remove deprecated configuration and setup vhost Removed deprecated options (package, extraComponents, extraPackages, config) and services (mosquitto, go2rtc) from Home Assistant configuration. Added new vhost configuration for pepe.core.vhost.hosts with host and port settings. Simplified service setup by eliminating redundant components and focusing on core vhost configuration. --- modules/services/homeassistant/default.nix | 46 ++-------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/modules/services/homeassistant/default.nix b/modules/services/homeassistant/default.nix index ce600ac..5da75f4 100644 --- a/modules/services/homeassistant/default.nix +++ b/modules/services/homeassistant/default.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let inherit (lib) mkIf; @@ -8,57 +8,17 @@ in { options.pepe.services.homeassistant = with lib; { enable = mkEnableOption "Enable Home Assistant"; - package = mkPackageOption pkgs "home-assistant" { }; domain = mkOption { type = types.str; default = null; }; - extraComponents = mkOption { - type = types.listOf types.str; - default = []; - description = "Additional components to enable in Home Assistant"; - }; - extraPackages = mkOption { - type = types.functionTo (types.listOf types.package); - default = _: []; - description = "Additional Python packages for Home Assistant"; - }; - config = mkOption { - type = types.attrs; - default = {}; - description = "Home Assistant configuration"; - }; }; config = mkIf cfg.enable { - services.home-assistant = { - enable = true; - package = cfg.package; - extraComponents = cfg.extraComponents; - extraPackages = cfg.extraPackages; - config = cfg.config; - }; - - services.mosquitto = { - enable = true; - listeners = [ - { - address = "127.0.0.1"; - acl = [ "pattern readwrite #" ]; - omitPasswordAuth = true; - settings.allow_anonymous = true; - } - ]; - }; - - services.go2rtc = { - enable = true; - settings.api.listen = "127.0.0.1:1984"; - }; - pepe.core.vhost.hosts.${cfg.domain} = { locations."/" = { - port = config.services.home-assistant.config.http.server_port or 8123; + host = "10.0.0.251"; + port = 8123; allowLAN = true; allowVPN = true; allowWAN = true;