Home Assistant: Difference between revisions

imported>Diogotcorreia
m Fix invalid syntax on automations and scenes examples
imported>Ibizaman
Custom components and lovelace modules can now be added declaratively
Line 141: Line 141:
==== Using custom components ====
==== Using custom components ====


We currently do not provide a way to declaratively manage custom components through the NixOS module. There is an open PR with an implementation, that still requires further work and discussion to make it a good solution.
We provide a way to declaratively manage custom components through the NixOS module with the [https://search.nixos.org/options?channel=unstable&show=services.home-assistant.customComponents&from=0&size=50&sort=relevance&type=packages&query=home-assistant services.home-assistant.customComponents] option.
 
* https://github.com/NixOS/nixpkgs/pull/160346
 
Until then custom components can be installed to <code><nowiki>/var/lib/hass/custom_components/</nowiki></code> as is the customary for Home Assistant.


Custom components can be found under [https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=home-assistant-custom-components pkgs.home-assistant-custom-components].


==== Using custom lovelace modules ====
==== Using custom lovelace modules ====


The support for custom lovelace modules is planned, same as for custom components.
We provide a way to declaratively manage custom lovelace modules through the NixOS module with the [https://search.nixos.org/options?channel=unstable&show=services.home-assistant.customLovelaceModules&from=0&size=50&sort=relevance&type=packages&query=home-assistant services.home-assistant.customLovelaceModules] option.
 
* https://github.com/NixOS/nixpkgs/pull/160346
 
Until then lovelace modules can be installed to <code><nowiki>/var/lib/hass/www/</nowiki></code>, which uses Home Assistants internal webserver to serve files below <code><nowiki>/local/</nowiki></code> on your installation. This webserver will not follow symlinks, which we will allow in the future by applying a patch, which will be reasonable safe to do because of all the hardening options we apply by default. The patch in the question is part of the PR above:


* https://raw.githubusercontent.com/mweinelt/nixpkgs/hass-custom-everything/pkgs/servers/home-assistant/patches/static-symlinks.patch
Custom components can be found under [https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=home-assistant-custom-lovelace-modules pkgs.home-assistant-custom-lovelace-modules].


=== Reusing existing YAML configuration ===
=== Reusing existing YAML configuration ===