diff --git a/hosts/home-assistant.cloonar.com/configuration.nix b/hosts/home-assistant.cloonar.com/configuration.nix index ddd63d1..0564c02 100644 --- a/hosts/home-assistant.cloonar.com/configuration.nix +++ b/hosts/home-assistant.cloonar.com/configuration.nix @@ -4,7 +4,7 @@ ./utils/modules/sops.nix ./utils/modules/lego/lego.nix ./utils/modules/nginx.nix - ./utils/modules/home-assistant/default.nix + ./utils/modules/home-assistant/new.nix ./utils/modules/mopidy.nix ./utils/modules/mosquitto.nix ./utils/modules/snapserver.nix diff --git a/utils/modules/home-assistant/new.nix b/utils/modules/home-assistant/new.nix new file mode 100644 index 0000000..92f31db --- /dev/null +++ b/utils/modules/home-assistant/new.nix @@ -0,0 +1,31 @@ +{}: +{ + virtualisation = { + podman = { + enable = true; + + # Create a `docker` alias for podman, to use it as a drop-in replacement + dockerCompat = true; + + # Required for containers under podman-compose to be able to talk to each other. + defaultNetwork.settings.dns_enabled = true; + # For Nixos version > 22.11 + #defaultNetwork.settings = { + # dns_enabled = true; + #}; + }; + }; + virtualisation.oci-containers = { + backend = "podman"; + containers.homeassistant = { + volumes = [ "home-assistant:/config" ]; + environment.TZ = "Europe/Vienna"; + image = "ghcr.io/home-assistant/home-assistant:sha256:17667d8849f01fb8a34f2eecff79beb50be0394928c8c4b64853648472ebee38"; # Warning: if the tag does not change, the image will not be updated + extraOptions = [ + "--network=host" + "--device=/dev/serial/by-id/usb-EnOcean_GmbH_EnOcean_USB_300_DC_FT5OI9YG-if00-port0:/dev/serial/by-id/usb-EnOcean_GmbH_EnOcean_USB_300_DC_FT5OI9YG-if00-port0" + ]; + }; + }; +} +