about summary refs log tree commit diff
path: root/nixos/modules/services/home-automation/home-assistant.nix
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-02-20 16:54:37 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-02-20 18:37:20 +0100
commite01ccd6245fe1fe34aa49aa48fe3d53e3b013c20 (patch)
tree62e0fad4da338f77da5afd139b6878d9ad1c6951 /nixos/modules/services/home-automation/home-assistant.nix
parent3fa7dc206a54265f04fc2ea2afd1cf1cdb650c83 (diff)
home-assistant: Inject extra dependencies through PYTHONPATH
Injecting configuration specific dependencies into the
propagatedBuildInputs of the home-assistant package forces alot of
rebuilds while setting up home-assistant, which is annoying.

By passing optional dependencies into home-assistant via the systemd
units PYTHONPATH environment variable, only he concatenation of
library paths in the systemd unit requires a rebuild.

This also means users can rely heavily on the cached home-assistant
package and will rarely have to build from source, if ever.
Diffstat (limited to 'nixos/modules/services/home-automation/home-assistant.nix')
-rw-r--r--nixos/modules/services/home-automation/home-assistant.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix
index 9f6f153a10568..6adc58ec58ec4 100644
--- a/nixos/modules/services/home-automation/home-assistant.nix
+++ b/nixos/modules/services/home-automation/home-assistant.nix
@@ -409,6 +409,7 @@ in {
         (optionalString (cfg.config != null) copyConfig) +
         (optionalString (cfg.lovelaceConfig != null) copyLovelaceConfig)
       ;
+      environment.PYTHONPATH = package.pythonPath;
       serviceConfig = let
         # List of capabilities to equip home-assistant with, depending on configured components
         capabilities = lib.unique ([