Patch makePythonWriter via overlay (upstream #521741), then drop the pypy2.7-* insecure allowance fleet-wide #131
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos#131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add a nixpkgs overlay that applies upstream NixOS/nixpkgs#521741 — the one-line
||→&&fix tomakePythonWriter's interpreter guard inpkgs/build-support/writers/scripts.nix:1203(fixes NixOS/nixpkgs#468459). With the overlay in place, eval no longer force-evaluates thepypy2Packagesset, so thepypy2.7-*insecure allowance can be removed from every host (the whole point of this issue).Background
On 26.05 the guard is a tautology:
No
pythonPackagescan equal both sets, so the||is always true (upstream confirms it should be&&). Evaluating the left operand force-evaluatespypy2Packages; on 26.05 those members are insecure (pypy2.7-setuptools-44.0.0, CVE-2025-47273), socheck-metaaborts host eval. The package is never built or installed — only force-evaluated by dead comparison logic.It reaches every host via the upstream
users-groupsshell-program-check assertion (nixos/modules/config/users-groups.nix), which maps over[ "fish" "xonsh" "zsh" ]per user and evaluatesuser.shell == pkgs.fish→ forcespkgs.fish(now Rust) →cargoDeps/fetchCargoVendor→fetch-cargo-vendor-util→ the buggy writer. No host actually configures fish; the assertion forces it regardless.Current workaround (already on nb, nas, fw): a
nixpkgs.config.allowInsecurePredicatematchingpypy2.7-*. This issue replaces that workaround with the real fix.Why not just wait for upstream
PR #521741 is open but unmerged (targets
master, idle since 2026-05-19), issue #468459 is stale, and there is norelease-26.05backport. The fix will not reach our 26.05 channel on its own for the foreseeable future.Open implementation question (for triage)
makePythonWriteris arec-scope member of the writers set, sowritePython3Bin/fetch-cargo-vendor-utilcapture the rec-internal reference — a naivepkgs.writers.makePythonWriteroverride will not take effect. Needs investigation: override/re-import the wholewritersattrset, or patch the nixpkgs source. This design call is why it's not auto-agent-ready yet.Acceptance criteria
utils/overlays/makeswritePython3Bin(and friends) stop force-evaluatingpypy2Packages, verified by eval passing without any pypy2.7 allowance.pypy2.7-*branch fromallowInsecurePredicateon nb and nas, and from the fw predicate; drop the obsolete explanatory comments.Sequencing / dependencies
References
nix-instantiate '<nixpkgs/nixos>' -A systemhost eval (full check-meta trace through the writer guard).