Home Assistant: Difference between revisions

Hexa (talk | contribs)
Hexa (talk | contribs)
Line 13: Line 13:


=== Virtual machine ===
=== Virtual machine ===
Home Assistant maintains their own operating system and provides [[QEMU]] (qcow2) and [[Virtualbox]] (vdi) compatible [https://www.home-assistant.io/installation/linux#install-home-assistant-operating-system images]. Home Assistant supports virtualization solutions like [[libvirt]] and [[Incus]], which can host such a virtual machine.
Home Assistant maintains their own operating system and provides [[QEMU]] (qcow2) and [[Virtualbox]] (vdi) compatible [https://www.home-assistant.io/installation/linux#install-home-assistant-operating-system images]. NixOS supports virtualization solutions like [[libvirt]] and [[Incus]], both of which wrap QEMU to host a virtual machine.


==== Example: ====
Example:
* [https://myme.no/posts/2021-11-25-nixos-home-assistant.html NixOS: Headless Home Assistant VM (myme.no)] using libvirt
* [https://myme.no/posts/2021-11-25-nixos-home-assistant.html NixOS: Headless Home Assistant VM (myme.no)] using libvirt


Line 21: Line 21:
Home Assistant also provides a [https://www.home-assistant.io/installation/linux#install-home-assistant-container container image] for OCI compatible runtimes.
Home Assistant also provides a [https://www.home-assistant.io/installation/linux#install-home-assistant-container container image] for OCI compatible runtimes.


==== Example: ====
The following example configuration uses [[podman]] to download and run the <code>home-assistant:stable</code> image. The frontend will be available via HTTP on port <code>tcp/8123</code> in the host network namespace and can be reverse proxied from there.  
The following example configuration uses podman to download and run the <code>home-assistant:stable</code> image. The frontend will be available via HTTP on port <code>tcp/8123</code> in the host network namespace and could be reverse proxied from there.  


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 36: Line 35:
         # Use the host network namespace for all sockets
         # Use the host network namespace for all sockets
         "--network=host"
         "--network=host"
         # Pass devices into the container, so Home Assistant discover and make use of them
         # Pass devices into the container, so Home Assistant can discover and make use of them
         "--device=/dev/ttyACM0:/dev/ttyACM0"
         "--device=/dev/ttyACM0:/dev/ttyACM0"
       ];
       ];