diff --git a/flake.nix b/flake.nix index 379e0ed..2dcf5f6 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ # flake for blakes nixos config # define new devices in outputs -# generation: 279 current 2025-10-11 05:35:16 25.05.20251006.20c4598 6.12.50 * +# generation: 280 current 2025-10-11 05:36:52 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 68ce1ec..b65e277 100644 --- a/modules/homelab/services/smarthome/homeassistant/default.nix +++ b/modules/homelab/services/smarthome/homeassistant/default.nix @@ -55,75 +55,53 @@ in extraGroups = []; }; - 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.${service} = { -# 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 -# ]; -# # imperative config -# config = null; -# lovelaceConfig = null; -# configDir = cfg.data_dir; -# # declartive poggers! -## config = { -## # Includes dependencies for a basic setup -## default_config = {}; -## }; + # 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 + ]; + # imperative config + config = null; + lovelaceConfig = null; + configDir = cfg.data_dir; + # declartive poggers! +# config = { +# # Includes dependencies for a basic setup +# default_config = {}; +# }; + }; + + + # override umask to make permissions work out +# systemd.services.${service}.serviceConfig = { + UMask = lib.mkForce "0007"; + User = lib.mkForce ${service}; + Group = lib.mkForce ${service}; # }; -# -# -# # override umask to make permissions work out -## systemd.services.${service}.serviceConfig = { -## UMask = lib.mkForce "0007"; -## User = lib.mkForce ${service}; -## Group = lib.mkForce ${service}; -## }; -# -------------------------------------------------------------------------------- # open firewall networking.firewall.allowedTCPPorts = [ cfg.port 8123 ]; @@ -161,14 +139,37 @@ in }; }; -# sops.secrets = { -# "${service}_" = { -# owner = "${service}"; -# group = "${service}"; -# }; -# }; - # add to backups modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ]; }; } + + + + + + +# 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; +# }; +# }; +# }; + +