From 73e10d9d5a150c2dbaac705389b9ca41fcc0626d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 4 Sep 2022 16:01:45 +0200 Subject: [PATCH] paperless: Expose python environment in passthru This allows adding more python dependencies through overrides. --- pkgs/applications/office/paperless-ngx/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index 679a732c2d67..a42ec844d115 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -16,7 +16,7 @@ let # Use specific package versions required by paperless-ngx - py = python3.override { + python = python3.override { packageOverrides = self: super: { django = super.django_4; @@ -51,7 +51,7 @@ let path = lib.makeBinPath [ ghostscript imagemagick jbig2enc optipng pngquant qpdf tesseract4 unpaper ]; in -py.pkgs.pythonPackages.buildPythonApplication rec { +python.pkgs.pythonPackages.buildPythonApplication rec { pname = "paperless-ngx"; version = "1.8.0"; @@ -63,7 +63,7 @@ py.pkgs.pythonPackages.buildPythonApplication rec { format = "other"; - propagatedBuildInputs = with py.pkgs.pythonPackages; [ + propagatedBuildInputs = with python.pkgs.pythonPackages; [ aioredis arrow asgiref @@ -169,7 +169,7 @@ py.pkgs.pythonPackages.buildPythonApplication rec { # Compile manually because `pythonRecompileBytecodeHook` only works for # files in `python.sitePackages` postBuild = '' - ${py.interpreter} -OO -m compileall src + ${python.interpreter} -OO -m compileall src ''; installPhase = '' @@ -181,7 +181,7 @@ py.pkgs.pythonPackages.buildPythonApplication rec { --prefix PATH : "${path}" ''; - checkInputs = with py.pkgs.pythonPackages; [ + checkInputs = with python.pkgs.pythonPackages; [ pytest-django pytest-env pytest-sugar @@ -207,6 +207,7 @@ py.pkgs.pythonPackages.buildPythonApplication rec { ''; passthru = { + inherit python; # PYTHONPATH of all dependencies used by the package pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs; inherit path;