@@ -48,13 +48,10 @@ let
4848 pyhome = "${pythonEnv}";
4949 env =
5050 # Argh, uwsgi expects list of key-values there instead of a dictionary.
51− let env' = c.env or [];
52− getPath =
53− x: if hasPrefix "PATH=" x
54− then substring (stringLength "PATH=") (stringLength x) x
55− else null;
56− oldPaths = filter (x: x != null) (map getPath env');
57− in env' ++ [ "PATH=${optionalString (oldPaths != []) "${last oldPaths}:"}${pythonEnv}/bin" ];
51+ let envs = partition (hasPrefix "PATH=") (c.env or []);
52+ oldPaths = map (x: substring (stringLength "PATH=") (stringLength x) x) envs.right;
53+ paths = oldPaths ++ [ "${pythonEnv}/bin" ];
54+ in [ "PATH=${concatStringsSep ":" paths}" ] ++ envs.wrong;
5855 }
5956 else if isEmperor
6057 then {