Home Assistant: Difference between revisions
imported>Mweinelt |
imported>Mweinelt |
||
| Line 24: | Line 24: | ||
== NixOS Module == | == NixOS Module == | ||
You could run home-assistant using the NixOS module system at | You could run home-assistant using the NixOS module system at <code>services-home-assistant</code>. As of 2021-11-28 we have roughly 70% of component dependencies packaged. There are two major ways of running home-assistant using the module system. | ||
=== Declarative configuration === | === Declarative configuration === | ||
Set up your home-assistant by configuring <code>services.home-assistant.config</code | Set up your home-assistant by configuring the <code>services.home-assistant.config</code attribute set as if it were your home-assistant YAML configuration. The module parses the root and platforms level to automatically discover integrations used and will add them to your home-assistant package. The following is a minimal starting configuration, that has all the dependencies that are required to complete the initial configuration flow, that creates your first user. | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
| Line 55: | Line 55: | ||
=== Reusing existing YAML configuration === | === Reusing existing YAML configuration === | ||
The module also supports passing it an existing configuration, however that comes with certain drawbacks. For example we cannot automatically detect the components, that your configuration requires. In that scenario you will need to resolve dependencies manually using <code>extraComponents</code>. Also you will be unable to reuse configuration values between parts of your NixOS configuration. A barebones setup to get you started may look like this: | The module also supports passing it an existing configuration, however that comes with certain drawbacks. For example we cannot automatically detect the components, that your configuration requires. In that scenario you will need to resolve dependencies manually using the packages <code>extraComponents</code> parameter. Also you will be unable to reuse configuration values between parts of your NixOS configuration. A barebones setup to get you started may look like this: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||