diff --git a/modules/default.nix b/modules/default.nix index 8a8b481..a06a918 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -53,7 +53,7 @@ builtins.listToAttrs (builtins.map ./services/docker.nix ./services/fail2ban.nix ./services/gnome-xrdp.nix - ./services/home-assistant.nix + ./services/home-assistant ./services/homepage.nix ./services/media-server.nix ./services/minecraft-atm9-tts.nix diff --git a/modules/services/home-assistant.nix b/modules/services/home-assistant/default.nix similarity index 85% rename from modules/services/home-assistant.nix rename to modules/services/home-assistant/default.nix index 042636c..2d0a1b6 100644 --- a/modules/services/home-assistant.nix +++ b/modules/services/home-assistant/default.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, config, self, ... }: let cfg = config.modules.home-assistant; @@ -17,13 +17,14 @@ in config = { virtualisation.oci-containers.containers."homeassistant" = { - volumes = cfg.volumes ++ lib.optionals cfg.addDbusVolume [ "/run/dbus:/run/dbus:ro" ]; + volumes = cfg.volumes ++ lib.optionals cfg.addDbusVolume [ "/run/dbus:/run/dbus:ro" ] ++ [ (builtins.toString ./. + ":/patches") ]; environment.TZ = config.time.timeZone; image = "ghcr.io/home-assistant/home-assistant:stable"; extraOptions = [ "--network=host" "--pull=newer" ]; + entrypoint ="/patches/start.sh"; }; networking.firewall.allowedTCPPorts = [ 8123 ]; diff --git a/modules/services/home-assistant/start.sh b/modules/services/home-assistant/start.sh new file mode 100755 index 0000000..1cf25d8 --- /dev/null +++ b/modules/services/home-assistant/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +pip install py_mini_racer && exec /init