36 lines
804 B
Nix
36 lines
804 B
Nix
|
{ pkgs, ... }:
|
||
|
let
|
||
|
pythonldlibpath = pkgs.lib.makeLibraryPath (with pkgs; [
|
||
|
libGL
|
||
|
glib
|
||
|
zlib
|
||
|
zstd
|
||
|
stdenv.cc.cc
|
||
|
curl
|
||
|
openssl
|
||
|
attr
|
||
|
libssh
|
||
|
bzip2
|
||
|
libxml2
|
||
|
acl
|
||
|
libsodium
|
||
|
util-linux
|
||
|
xz
|
||
|
systemd
|
||
|
]);
|
||
|
# Darwin requires a different library path prefix
|
||
|
wrapPrefix = if (!pkgs.stdenv.isDarwin) then "LD_LIBRARY_PATH" else "DYLD_LIBRARY_PATH";
|
||
|
patchedpython = (pkgs.symlinkJoin {
|
||
|
name = "python";
|
||
|
paths = [ pkgs.python312 ];
|
||
|
buildInputs = [ pkgs.makeWrapper ];
|
||
|
postBuild = ''
|
||
|
wrapProgram "$out/bin/python3.12" --prefix ${wrapPrefix} : "${pythonldlibpath}"
|
||
|
'';
|
||
|
});
|
||
|
in {
|
||
|
home.packages = [
|
||
|
patchedpython
|
||
|
];
|
||
|
}
|