From 82f42b9329c0d51975c4548ed6dbefaa8bf37228 Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Fri, 17 Apr 2026 00:15:59 +0200 Subject: [PATCH] Add C/C++ libraries for Python venv with compiled packages support --- nixos/modules/development.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/nixos/modules/development.nix b/nixos/modules/development.nix index e041461..d2277ed 100644 --- a/nixos/modules/development.nix +++ b/nixos/modules/development.nix @@ -24,6 +24,14 @@ selectedPackages = 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 { # Core development tools @@ -37,7 +45,16 @@ cmake ripgrep 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) #virtualisation.docker.enable = true;