Repository navigation
fix(devenv): take Python 3.12 from devenv-nixpkgs so it comes from the cache - #13
Merged
Merged
Conversation
…e cache languages.python.version pulled CPython from nixpkgs-python, and devenv.yaml made nixpkgs-python follow our nixpkgs. nixpkgs-python's binary cache is built against its own pinned nixpkgs, so with that override the interpreter missed the cache and was compiled locally. Use pkgs.python312 from devenv-nixpkgs instead; its 3.12.12 build is on cache.nixos.org. pyproject.toml only requires ">=3.12". Drop the nixpkgs-python input and its cachix entry. devenv.yaml never declared git-hooks; the old lock carried it as an implicit input. Re-locking with devenv 2.4 dropped it, which would fail the git-hooks assertion. Declare it explicitly; the lock keeps the same git-hooks revision. Skip the version banner while direnv loads the shell. It started four tools, including basedpyright on Node, on every load.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The lock pinned the devenv modules from early 2026. With the devenv 2.4
CLI the shell failed to build ("The option `dotenv.resolved' was
accessed but has no value defined"), and direnv fell back to the host
Python. Update only the devenv input with `devenv update devenv`;
nixpkgs and git-hooks stay as they are.
devenv's Python module sources the venv that uv sync creates only when languages.python.venv.enable is set (initUvScript in src/modules/languages/python/default.nix). Without it, python, pytest and ty in the shell came from outside the venv, and the ty hook could not resolve the project's imports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
devenv の Python を、公開キャッシュにある devenv-nixpkgs の
python312に替えます。新しい作業場で CPython をソースからビルドしなくなります。languages.python = { enable = true; - version = "3.12"; # nixpkgs-python(follows nixpkgs)→ キャッシュに当たらず手元でビルド + package = pkgs.python312; # devenv-nixpkgs の 3.12.12 → cache.nixos.org から取得 };devenv.yamlからnixpkgs-pythonの input と cachix のnixpkgs-pythonを外しました。git-hooksをdevenv.yamlに明示しました。これまでは lock にだけ暗黙の input として入っていて、devenv 2.4 で lock を作り直すと消え、git-hooks の assertion で失敗するためです。rev は同じ(5eaaedde414f)です。devenv shellでは従来どおり出ます。devenv update devenv、2026-10-26 の6af962f)。2026 年初めの module は devenv 2.4 の CLI と合わず、The option `dotenv.resolved' was accessed but has no value definedでシェルの組み立てに失敗し、direnv がホストの Python に落ちていました。languages.python.venv.enable = trueを足しました。devenv の Python module は、uv sync が作る venv をこの設定のときだけ有効にします(src/modules/languages/python/default.nixのinitUvScript)。無いと python・pytest・ty が venv の外のものになり、ty の hook が import を解決できません。原因:
nixpkgs-pythonをfollows: nixpkgsにしていたことです。nixpkgs-python の README には「Do not override the nixpkgs input when using this flake. The cached builds are tied to the pinned nixpkgs revision」とあります。Evidence
version = "3.12"で、nixpkgs-python の CPython を手元でビルドする設定だった。devenv eval languages.python.packageはpython3-3.12.12-envを返します。その中の2j3gnwp0hsbvrirf23w1q344q7gbcy92-python3-3.12.12は cache.nixos.org にあります(narinfo が 200)。devenv eval git-hooks.installationScriptが評価でき、git-hooks の input が読み込まれることを確かめました。devenv.lockで消えたのはnixpkgs-python・flake-compat_2・root のpre-commit-hooksの別名だけです。nixpkgs・git-hooks の rev は変わりません(devenv は上の 4 で更新)。.devenv/state/venv/bin/pythonになることを確かめました。手元でビルドしたのは環境の包みだけです。main だけでは git-hooks の assertion で、4 の前はdotenv.resolvedで失敗します。Merge Danger
Door: two-way
Blast Radius: 手元の devenv シェル
pyproject.tomlは>=3.12だけを求めるので、patch 版の違いは影響しません。devenv-slow-2-b5