nixos/system/home/programming/pythonWrapped.nix

28 lines
562 B
Nix
Raw Normal View History

{
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 ]; }