From d759a3e7477f53086428e5e2ce78388f5fc9d6b4 Mon Sep 17 00:00:00 2001 From: blake Date: Sat, 11 Oct 2025 17:35:22 -0500 Subject: [PATCH] 308 current 2025-10-11 17:30:56 25.05.20251006.20c4598 6.12.50 * --- flake.nix | 2 +- .../smarthome/homeassistant/default.nix | 123 +++++++++--------- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/flake.nix b/flake.nix index 4ae6f4f..31e60de 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ # flake for blakes nixos config # define new devices in outputs -# generation: 307 current 2025-10-11 17:27:31 25.05.20251006.20c4598 6.12.50 * +# generation: 308 current 2025-10-11 17:30:56 25.05.20251006.20c4598 6.12.50 * { description = "blakes nix config"; inputs = { diff --git a/modules/homelab/services/smarthome/homeassistant/default.nix b/modules/homelab/services/smarthome/homeassistant/default.nix index 78242b2..bd3aa29 100644 --- a/modules/homelab/services/smarthome/homeassistant/default.nix +++ b/modules/homelab/services/smarthome/homeassistant/default.nix @@ -55,48 +55,29 @@ in extraGroups = []; }; -# here lies my tough, and I mean fucking tough, swing at -# getting this to work bare metal, ggs ill see you again -# - didnt take long -# -------------------------------------------------------------------------------- - # enable the ${service} service - services.${nixservice} = { - enable = true; - package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.home-assistant; - extraComponents = [ - # required for onboarding - "analytics" - "google_translate" - "met" - "radio_browser" - "shopping_list" - "isal" - "default_config" - "mqtt" - ]; - extraPackages = python3Packages: with python3Packages; [ - psycopg2 - universal-silabs-flasher - getmac - zha - ha-silabs-firmware-client - paho-mqtt - aiomqtt - aiounifi - ibeacon-ble - ]; - # imperative config - config = null; - lovelaceConfig = null; - configDir = cfg.data_dir; - # declartive poggers! -# config = { -# # Includes dependencies for a basic setup -# default_config = {}; -# }; + # still suss as fuck bro man fuck + virtualisation.oci-containers.containers = { + hass = { + image = "homeassistant/home-assistant:stable"; + autoStart = true; + extraOptions = [ + "--pull=newer" + ]; + volumes = [ + "${cfg.data_dir}:/config" + ]; + ports = [ + "0.0.0.0:7704:8123" + "0.0.0.0:4141:4141" + ]; + environment = { + TZ = homelab.tz; + PUID = toString config.users.users.${service}.uid; + PGID = toString config.users.groups.${service}.gid; + }; + }; }; - # override umask to make permissions work out systemd.services.${service}.serviceConfig = { UMask = lib.mkForce "0007"; @@ -144,7 +125,7 @@ in url = "https://hass.${homelab.base_domain}"; error-url = "http://${cfg.url}:${toString cfg.port}"; check-url = "http://${homelab.host_ip}:${toString cfg.port}"; - icon = "di:${service}"; }]; + icon = "di:${nixservice}"; }]; # add to backups modules.system.backups.baks = { @@ -158,27 +139,45 @@ in -# still suss as fuck bro man fuck -# virtualisation.oci-containers.containers = { -# homeassistant = { -# image = "homeassistant/home-assistant:stable"; -# autoStart = true; -# extraOptions = [ -# "--pull=newer" -# ]; -# volumes = [ -# "${cfg.data_dir}:/config" -# ]; -# ports = [ -# "0.0.0.0:7704:8123" -# "0.0.0.0:4141:4141" -# ]; -# environment = { -# TZ = homelab.tz; -# PUID = toString config.users.users.${service}.uid; -# PGID = toString config.users.groups.${service}.gid; -# }; -# }; +# here lies my tough, and I mean fucking tough, swing at +# getting this to work bare metal, ggs ill see you again +# - didnt take long +# -------------------------------------------------------------------------------- +# # enable the ${service} service +# services.${nixservice} = { +# enable = true; +# package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.home-assistant; +# extraComponents = [ +# # required for onboarding +# "analytics" +# "google_translate" +# "met" +# "radio_browser" +# "shopping_list" +# "isal" +# "default_config" +# "mqtt" +# ]; +# extraPackages = python3Packages: with python3Packages; [ +# psycopg2 +# universal-silabs-flasher +# getmac +# zha +# ha-silabs-firmware-client +# paho-mqtt +# aiomqtt +# aiounifi +# ibeacon-ble +# ]; +# # imperative config +# config = null; +# lovelaceConfig = null; +# configDir = cfg.data_dir; +# # declartive poggers! +## config = { +## # Includes dependencies for a basic setup +## default_config = {}; +## }; # };