From c3934b138c8e9b953de5fe11dfb171396bc2ad90 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Thu, 12 Mar 2026 10:09:07 -0500 Subject: Fix NixOS CI: use venv for pinned pybind11 (nix Python is immutable) Nix Python environments can't be modified with pip directly. Create a temporary venv with --system-site-packages and install pybind11==2.13.6 into it. Co-Authored-By: Claude Opus 4.6 --- nix/mobase-shell.nix | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'nix') diff --git a/nix/mobase-shell.nix b/nix/mobase-shell.nix index c6b326e..c39dd02 100644 --- a/nix/mobase-shell.nix +++ b/nix/mobase-shell.nix @@ -1,5 +1,12 @@ { pkgs ? import {} }: +let + python = pkgs.python313; + pythonWithPkgs = python.withPackages (ps: [ + ps.sip + ps.pyqt6 + ]); +in pkgs.mkShell { nativeBuildInputs = with pkgs; [ cmake @@ -19,11 +26,8 @@ pkgs.mkShell { qt6.qtsvg qt6.qtwayland - # Python (pybind11 installed via pip in shellHook to pin version) - python313 - python313Packages.pip - python313Packages.sip - python313Packages.pyqt6 + # Python + pythonWithPkgs # Libraries boost @@ -45,8 +49,13 @@ pkgs.mkShell { ]; shellHook = '' - # Pin pybind11 to 2.13.6 (must match Docker build for ABI compat) - pip install --quiet pybind11==2.13.6 2>/dev/null || true + # Create a temporary venv to install pinned pybind11 (nixpkgs version is too new) + if [ ! -d .nix-venv ]; then + python3 -m venv .nix-venv --system-site-packages + .nix-venv/bin/pip install --quiet pybind11==2.13.6 + fi + export PATH="$PWD/.nix-venv/bin:$PATH" + export PYTHONPATH="$PWD/.nix-venv/lib/python3.13/site-packages:$PYTHONPATH" export CMAKE_PREFIX_PATH="${pkgs.qt6.qtbase}:${pkgs.qt6.qtwebengine}:${pkgs.qt6.qtwebsockets}:${pkgs.qt6.qtsvg}:$CMAKE_PREFIX_PATH" ''; } -- cgit v1.3.1