paperless: move PYTHONPATH definition to module

`paperless-ngx.pythonPath` was incomplete due to the missing paperless-ngx
source, so it had to be amended in the service.
Instead of amending it, define it entirely in the service.

This allows an override of `paperless-ngx.propagatedBuildInputs` to be reflected
in the service's PYTHONPATH.
This commit is contained in:
Erik Arvstedt 2022-09-05 10:12:39 +02:00
parent 310b9fe58d
commit 783f8f16c1
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
2 changed files with 2 additions and 6 deletions

View File

@ -297,7 +297,7 @@ in
};
environment = env // {
PATH = mkForce pkg.path;
PYTHONPATH = "${pkg.pythonPath}:${pkg}/lib/paperless-ngx/src";
PYTHONPATH = "${pkg.python.pkgs.makePythonPath pkg.propagatedBuildInputs}:${pkg}/lib/paperless-ngx/src";
};
# Allow the web interface to access the private /tmp directory of the server.
# This is required to support uploading files via the web interface.

View File

@ -207,11 +207,7 @@ python.pkgs.pythonPackages.buildPythonApplication rec {
'';
passthru = {
inherit python;
# PYTHONPATH of all dependencies used by the package
pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs;
inherit path;
inherit python path;
tests = { inherit (nixosTests) paperless; };
};