diff options
| author | 2026-05-14 11:43:18 +0100 | |
|---|---|---|
| committer | 2026-05-14 11:43:18 +0100 | |
| commit | 0a0d087b2125b6c7b6461d58f57265bc56b3b22b (patch) | |
| tree | 9afe7631dba8cd50f918060338d1cac3ef2ca3a1 | |
| parent | 719d4c5518bda64bd0f8ab8b20d9cb2fe84b5666 (diff) | |
| download | dotfiles-0a0d087b2125b6c7b6461d58f57265bc56b3b22b.tar.gz dotfiles-0a0d087b2125b6c7b6461d58f57265bc56b3b22b.tar.bz2 dotfiles-0a0d087b2125b6c7b6461d58f57265bc56b3b22b.zip | |
fix(remote-dev): expose python3.11 (versioned-only) for Mason pip installs
Ubuntu 20.04's stock python3 is 3.8.10, which fails Mason's pep440
checks for autotools-language-server, codespell, mdformat,
nginx-language-server, systemdlint, yamllint (all want >=3.9 or
>=3.10).
Mason's pypi installer (verified against upstream
lua/mason-core/installer/managers/pypi.lua) probes python3.6 through
python3.14 in PATH in addition to plain python3, so providing
python3.11 alone (without python3) is enough.
Add a thin runCommand derivation that symlinks ONLY
pkgs.python311/bin/python3.11 into the profile — not python3 or
python — so we don't shadow Ubuntu's /usr/bin/python3 and keep the
leaf-tools policy intact.
| -rw-r--r-- | remote-dev/home.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/remote-dev/home.nix b/remote-dev/home.nix index d178eca..c5dfcc7 100644 --- a/remote-dev/home.nix +++ b/remote-dev/home.nix @@ -84,7 +84,18 @@ in # Editor/AI agent runtimes — NOT for project builds (see policy above) nodejs_24 # Mason npm LSPs + copilot-language-server (needs Node 24, see ai.lua) uv # Mason python LSPs in isolated venvs; brings `uv`/`uvx` only - jre # for Mason's groovy-language-server (headless Java runtime) + jre # for Mason's groovy-language-server (headless Java runtime) + + # Mason's pip-installer probes `python3.13`, `python3.12`, ..., `python3.10` + # in PATH (in addition to `python3`) when picking an interpreter for the + # per-pkg venvs it creates. Ubuntu 20.04 ships only `python3` = 3.8 which + # is too old for codespell/mdformat/yamllint/etc. We expose ONLY the + # versioned `python3.11` binary so we don't shadow the system `python3` + # (preserving the leaf-tools policy: system builds keep using /usr/bin/python3). + (pkgs.runCommand "python311-versioned-only" { } '' + mkdir -p $out/bin + ln -s ${pkgs.python311}/bin/python3.11 $out/bin/python3.11 + '') # Mason fallbacks: Mason's pip/cargo installers can't run on this VM # under our leaf-tools policy, so we provide these binaries on PATH and |
