immich-machine-learning: only add run time dependencies to PYTHONPATH (#345200)

This commit is contained in:
Robert Schütz 2024-09-28 17:40:51 -07:00 committed by GitHub
commit d397f461d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@
fetchFromGitHub,
immich,
python3,
nixosTests,
}:
let
python = python3.override {
@ -27,7 +28,7 @@ let
};
};
in
python.pkgs.buildPythonApplication {
python.pkgs.buildPythonApplication rec {
pname = "immich-machine-learning";
inherit (immich) version;
src = "${immich.src}/machine-learning";
@ -83,7 +84,7 @@ python.pkgs.buildPythonApplication {
cp -r ann $out/${python.sitePackages}/
makeWrapper ${lib.getExe python.pkgs.gunicorn} "''${!outputBin}"/bin/machine-learning \
--prefix PYTHONPATH : "$out/${python.sitePackages}:$PYTHONPATH" \
--prefix PYTHONPATH : "$out/${python.sitePackages}:${python.pkgs.makePythonPath dependencies}" \
--set-default MACHINE_LEARNING_WORKERS 1 \
--set-default MACHINE_LEARNING_WORKER_TIMEOUT 120 \
--set-default MACHINE_LEARNING_CACHE_FOLDER /var/cache/immich \
@ -96,6 +97,10 @@ python.pkgs.buildPythonApplication {
--log-config-json $out/share/immich/log_conf.json"
'';
passthru.tests = {
inherit (nixosTests) immich;
};
meta = {
description = "Self-hosted photo and video backup solution (machine learning component)";
homepage = "https://immich.app/";