From 89ec12be1d827c7381c0b89e377f3149b1d19ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 16 Jan 2024 23:18:51 +0200 Subject: [PATCH] uwsgi: fix pythonpath --- pkgs/e11sync-backend.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkgs/e11sync-backend.nix b/pkgs/e11sync-backend.nix index 9c98b8a..49116a2 100644 --- a/pkgs/e11sync-backend.nix +++ b/pkgs/e11sync-backend.nix @@ -13,16 +13,18 @@ geoip-mmdb, }: let uwsgi-python = uwsgi.override {plugins = ["python3"];}; + pythonEnv = + python3.withPackages + (ps: [ + ps.django + ps.django-compressor + ps.geoip2 + ]); in stdenv.mkDerivation { name = "e11sync-backend"; propagatedBuildInputs = [ - (python3.withPackages - (ps: [ - ps.django - ps.django-compressor - ps.geoip2 - ])) + pythonEnv libmaxminddb ]; nativeBuildInputs = [makeWrapper]; @@ -41,6 +43,7 @@ in --chdir $out/app \ --set-default E11SYNC_HTTP_PORT ${toString backendPort} \ --add-flags "--plugin ${uwsgi-python}/lib/uwsgi/python3_plugin.so" \ + --add-flags "--python-path ${pythonEnv}/lib/${pythonEnv.libPrefix}/site-packages" \ --add-flags "--http-socket 127.0.0.1:${toString backendPort}" \ --add-flags "--wsgi-file e11sync/wsgi.py" \ --add-flags --master \