mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-09 03:55:44 +03:00
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.
This commit is contained in:
parent
3fa7dc206a
commit
e01ccd6245
2 changed files with 3 additions and 1 deletions
|
@ -409,6 +409,7 @@ in {
|
||||||
(optionalString (cfg.config != null) copyConfig) +
|
(optionalString (cfg.config != null) copyConfig) +
|
||||||
(optionalString (cfg.lovelaceConfig != null) copyLovelaceConfig)
|
(optionalString (cfg.lovelaceConfig != null) copyLovelaceConfig)
|
||||||
;
|
;
|
||||||
|
environment.PYTHONPATH = package.pythonPath;
|
||||||
serviceConfig = let
|
serviceConfig = let
|
||||||
# List of capabilities to equip home-assistant with, depending on configured components
|
# List of capabilities to equip home-assistant with, depending on configured components
|
||||||
capabilities = lib.unique ([
|
capabilities = lib.unique ([
|
||||||
|
|
|
@ -355,7 +355,7 @@ in python.pkgs.buildPythonApplication rec {
|
||||||
yarl
|
yarl
|
||||||
# Implicit dependency via homeassistant/requirements.py
|
# Implicit dependency via homeassistant/requirements.py
|
||||||
setuptools
|
setuptools
|
||||||
] ++ componentBuildInputs ++ extraBuildInputs;
|
];
|
||||||
|
|
||||||
makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip";
|
makeWrapperArgs = lib.optional skipPip "--add-flags --skip-pip";
|
||||||
|
|
||||||
|
@ -431,6 +431,7 @@ in python.pkgs.buildPythonApplication rec {
|
||||||
getPackages
|
getPackages
|
||||||
python
|
python
|
||||||
supportedComponentsWithTests;
|
supportedComponentsWithTests;
|
||||||
|
pythonPath = python3.pkgs.makePythonPath (componentBuildInputs ++ extraBuildInputs);
|
||||||
intents = python.pkgs.home-assistant-intents;
|
intents = python.pkgs.home-assistant-intents;
|
||||||
tests = {
|
tests = {
|
||||||
nixos = nixosTests.home-assistant;
|
nixos = nixosTests.home-assistant;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue