Add C/C++ libraries for Python venv with compiled packages support

This commit is contained in:
2026-04-17 00:15:59 +02:00
parent 69e81bb6e0
commit 82f42b9329
+18 -1
View File
@@ -24,6 +24,14 @@
selectedPackages = selectedPackages =
lib.concatMap (lang: languagePackages.${lang} or []) cfg.languages; lib.concatMap (lang: languagePackages.${lang} or []) cfg.languages;
# C/C++ libraries needed for compiled Python packages (numpy, etc.)
pythonDevLibraries = with pkgs;
lib.optionals (lib.elem "python" cfg.languages) [
glibc
stdenv.cc.cc.lib
libxcrypt
];
in lib.mkIf cfg.enable { in lib.mkIf cfg.enable {
# Core development tools # Core development tools
@@ -37,7 +45,16 @@
cmake cmake
ripgrep ripgrep
jq jq
] ++ selectedPackages; ] ++ selectedPackages ++ pythonDevLibraries;
# Set library paths for venv compatibility with compiled packages
environment.variables = lib.mkIf (lib.elem "python" cfg.languages) {
LD_LIBRARY_PATH = lib.makeLibraryPath (with pkgs; [
glibc
stdenv.cc.cc.lib
libxcrypt
]);
};
# Enable container support (optional) # Enable container support (optional)
#virtualisation.docker.enable = true; #virtualisation.docker.enable = true;