Create Python Wrapper

This commit is contained in:
Thomas Avé 2024-12-26 15:56:35 +01:00
parent 3ced4c6162
commit 9180f5b309
4 changed files with 40 additions and 5 deletions

View File

@ -8,11 +8,11 @@
"locked": {
"lastModified": 1,
"narHash": "sha256-DuhR3y0gPZG0AJ2FDd+nUKzQMwT+c/DFIUWNDQ5Uyx4=",
"path": "/nix/store/v7xsk4kvdnnpj7zvr4bl47wxycbx4qy6-source/home/ags",
"path": "/nix/store/b101vshx5jj03vhqdh6j12hk6vkbk9x8-source/home/ags",
"type": "path"
},
"original": {
"path": "/nix/store/v7xsk4kvdnnpj7zvr4bl47wxycbx4qy6-source/home/ags",
"path": "/nix/store/b101vshx5jj03vhqdh6j12hk6vkbk9x8-source/home/ags",
"type": "path"
}
},

View File

@ -10,9 +10,8 @@
nodejs
luarocks
jre
python3
python311Packages.pip
python311Packages.debugpy
python312Packages.pip
python312Packages.debugpy
unzip
dotnet-sdk_8
cargo

View File

@ -2,6 +2,7 @@
{
imports = [
(import ./common.nix { inherit inputs config pkgs; })
(import ./python.nix { inherit inputs config pkgs; })
(import ../hyprland { inherit inputs pkgs; })
../rofi
../alacritty

35
home/utils/python.nix Normal file
View File

@ -0,0 +1,35 @@
{ 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
];
}