Focus just on wrapping python for venv creation (using copies) rather than being activated every time
28 lines
562 B
Nix
28 lines
562 B
Nix
{
|
|
pkgs ? import <nixpkgs> { },
|
|
python3 ? pkgs.python3Full,
|
|
extraLibs ? [ ],
|
|
}:
|
|
let
|
|
inherit (pkgs) lib;
|
|
ldlibs = lib.makeLibraryPath (
|
|
(with pkgs; [
|
|
stdenv.cc.cc
|
|
glib
|
|
glibc
|
|
zlib
|
|
zstd
|
|
])
|
|
++ extraLibs
|
|
);
|
|
pythonWrapped = pkgs.symlinkJoin {
|
|
name = "python";
|
|
paths = [ python3 ];
|
|
buildInputs = [ pkgs.makeWrapper ];
|
|
postBuild = ''
|
|
for file in $out/bin/*; do wrapProgram "$file" --prefix LD_LIBRARY_PATH : "${ldlibs}"; done
|
|
'';
|
|
};
|
|
in
|
|
pkgs.mkShellNoCC { packages = [ pythonWrapped ]; }
|