about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorAneesh Agrawal <aneeshusa@gmail.com>2018-06-04 00:43:23 -0700
committerAneesh Agrawal <aneeshusa@gmail.com>2018-06-13 22:47:22 -0700
commitc2ab820d6aeafeeb02f748e47a5e140170775f77 (patch)
tree3616e2c5b65ecdee3fc6f70a3b0db6d716e1004e /nixos/modules
parent3e3a9e661d7ef83f9dfc26d948a12f8ee1334f6d (diff)
downloadnixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.tar
nixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.tar.gz
nixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.tar.bz2
nixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.tar.lz
nixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.tar.xz
nixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.tar.zst
nixlib-c2ab820d6aeafeeb02f748e47a5e140170775f77.zip
nixos/uwsgi: use python.withPackages
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/web-servers/uwsgi.nix8
1 files changed, 3 insertions, 5 deletions
diff --git a/nixos/modules/services/web-servers/uwsgi.nix b/nixos/modules/services/web-servers/uwsgi.nix
index 14596bb3add0..356b896a6dc9 100644
--- a/nixos/modules/services/web-servers/uwsgi.nix
+++ b/nixos/modules/services/web-servers/uwsgi.nix
@@ -31,9 +31,7 @@ let
         inherit python;
       };
 
-      penv = python.buildEnv.override {
-        extraLibs = (c.pythonPackages or (self: [])) pythonPackages;
-      };
+      pythonEnv = python.withPackages (c.pythonPackages or (self: []));
 
       uwsgiCfg = {
         uwsgi =
@@ -42,7 +40,7 @@ let
               inherit plugins;
             } // removeAttrs c [ "type" "pythonPackages" ]
               // optionalAttrs (python != null) {
-                pythonpath = "${penv}/${python.sitePackages}";
+                pythonpath = "${pythonEnv}/${python.sitePackages}";
                 env =
                   # Argh, uwsgi expects list of key-values there instead of a dictionary.
                   let env' = c.env or [];
@@ -51,7 +49,7 @@ let
                            then substring (stringLength "PATH=") (stringLength x) x
                            else null;
                       oldPaths = filter (x: x != null) (map getPath env');
-                  in env' ++ [ "PATH=${optionalString (oldPaths != []) "${last oldPaths}:"}${penv}/bin" ];
+                  in env' ++ [ "PATH=${optionalString (oldPaths != []) "${last oldPaths}:"}${pythonEnv}/bin" ];
               }
           else if c.type == "emperor"
             then {