about summary refs log tree commit diff
path: root/nixos/modules/services/home-automation
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2024-02-11 04:09:52 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2024-02-11 04:09:52 +0100
commit055a8f709ad75bec0aa723e7b413a695d24d7e3a (patch)
tree6f03f6e4bc47db6bc8d8557e6662b5f4ffbc0fc2 /nixos/modules/services/home-automation
parentad719a45037641bf03524b956b0e71218634528e (diff)
downloadnixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.tar
nixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.tar.gz
nixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.tar.bz2
nixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.tar.lz
nixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.tar.xz
nixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.tar.zst
nixlib-055a8f709ad75bec0aa723e7b413a695d24d7e3a.zip
nixos/home-assistant: always add dependencies for default integrations
These are loaded unconditionally during bootstrap, and home-assistant
will now fail to start, if these aren't provided.
Diffstat (limited to 'nixos/modules/services/home-automation')
-rw-r--r--nixos/modules/services/home-automation/home-assistant.nix41
1 files changed, 40 insertions, 1 deletions
diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix
index 5c2ea8f1840b..3423eebe9ed6 100644
--- a/nixos/modules/services/home-automation/home-assistant.nix
+++ b/nixos/modules/services/home-automation/home-assistant.nix
@@ -52,7 +52,7 @@ let
     hasAttrByPath (splitString "." component) cfg.config
     || useComponentPlatform component
     || useExplicitComponent component
-    || builtins.elem component cfg.extraComponents;
+    || builtins.elem component (cfg.extraComponents ++ cfg.defaultIntegrations);
 
   # Final list of components passed into the package to include required dependencies
   extraComponents = filter useComponent availableComponents;
@@ -103,6 +103,45 @@ in {
       description = lib.mdDoc "The config directory, where your {file}`configuration.yaml` is located.";
     };
 
+    defaultIntegrations = mkOption {
+      type = types.listOf (types.enum availableComponents);
+      # https://github.com/home-assistant/core/blob/dev/homeassistant/bootstrap.py#L109
+      default = [
+        "application_credentials"
+        "frontend"
+        "hardware"
+        "logger"
+        "network"
+        "system_health"
+
+        # key features
+        "automation"
+        "person"
+        "scene"
+        "script"
+        "tag"
+        "zone"
+
+        # built-in helpers
+        "counter"
+        "input_boolean"
+        "input_button"
+        "input_datetime"
+        "input_number"
+        "input_select"
+        "input_text"
+        "schedule"
+        "timer"
+
+        # non-supervisor
+        "backup"
+      ];
+      readOnly = true;
+      description = ''
+        List of integrations set are always set up, unless in recovery mode.
+      '';
+    };
+
     extraComponents = mkOption {
       type = types.listOf (types.enum availableComponents);
       default = [