nixos/system/home/programming/pythonWrapped.nix

34 lines
622 B
Nix
Raw Normal View History

{
pkgs ? import <nixpkgs> { },
python3 ? pkgs.python3Full,
2025-02-10 10:07:28 +00:00
extraPackages ? [ ],
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
2025-02-10 10:07:28 +00:00
pkgs.mkShellNoCC {
packages = [
pythonWrapped
pkgs.uv
] ++ extraPackages;
}