Home Assistant: Difference between revisions

imported>Mweinelt
update location block to use options instead of verbatim extraConfig
imported>Balsoft
Add a note about custom components and add balsoft's config
Line 58: Line 58:


This [https://github.com/NixOS/nixpkgs/pull/89136 pull request] describes how to add custom lovelace modules.
This [https://github.com/NixOS/nixpkgs/pull/89136 pull request] describes how to add custom lovelace modules.
= Add custom components =
In order to install a custom component, you have to place it in <code>/var/lib/hass/custom_components</code>. This can be achieved using systemd tmpfiles like so (for sonoff custom component):
<syntaxHighlight lang=nix>
  systemd.tmpfiles.rules = [
    "C /var/lib/hass/custom_components/sonoff - - - - ${sources.sonoff-lan}/custom_components/sonoff"
    "Z /var/lib/hass/custom_components 770 hass hass - -"
  ];
</syntaxHighlight>


== Example configurations ==
== Example configurations ==


- [https://github.com/Mic92/dotfiles/tree/master/nixos/eve/modules/home-assistant Mic92's config]
- [https://github.com/Mic92/dotfiles/tree/master/nixos/eve/modules/home-assistant Mic92's config]
- [https://github.com/balsoft/nixos-config/blob/master/modules/servers/home-assistant.nix Balsoft's config]