From bd0a6e60729b2dc0092d188f836073bff4d5ad3f Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Sun, 26 Apr 2026 14:20:26 +0530 Subject: [PATCH] fix: walk propagatedBuildInputs for plugin PYTHONPATH and collision check Uses python312.pkgs.requiredPythonModules to resolve the full transitive closure of extraPythonPackages. Without this, a plugin with third-party deps (e.g. requests) would fail at runtime if those deps weren't already in the sealed uv2nix venv. The collision check now also scans the full closure, catching transitive conflicts. --- nix/hermes-agent.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nix/hermes-agent.nix b/nix/hermes-agent.nix index 65f62c0e04..85ba71fb13 100644 --- a/nix/hermes-agent.nix +++ b/nix/hermes-agent.nix @@ -57,7 +57,12 @@ let sitePackagesPath = python312.sitePackages; - pythonPath = lib.makeSearchPath sitePackagesPath extraPythonPackages; + # Walk propagatedBuildInputs to include transitive Python deps in PYTHONPATH. + # Without this, a plugin listing e.g. requests as a dep would fail at runtime + # if requests isn't already in the sealed uv2nix venv. + allExtraPythonPackages = python312.pkgs.requiredPythonModules extraPythonPackages; + + pythonPath = lib.makeSearchPath sitePackagesPath allExtraPythonPackages; pyprojectHash = builtins.hashString "sha256" (builtins.readFile ../pyproject.toml); uvLockHash = @@ -122,7 +127,7 @@ for di in venv_sp.glob('*.dist-info'): break # Check each extra package for collisions -extras_dirs = [${lib.concatMapStringsSep ", " (p: "'${toString p}'") extraPythonPackages}] +extras_dirs = [${lib.concatMapStringsSep ", " (p: "'${toString p}'") allExtraPythonPackages}] for edir in extras_dirs: sp = pathlib.Path(edir) / '${sitePackagesPath}' if not sp.exists():