Skip to content

[BUG] just init fails on NixOS hosts: uv downloads a generic CPython NixOS can't execute #683

Closed

Description

@c-vigo

Description

On a NixOS host, onboarding via direnv allow + just init fails during the uv sync bootstrap step. The Nix dev-shell deliberately ships no Python on PATH and points uv at upstream's download metadata (UV_PYTHON_DOWNLOADS_JSON_URL) so uv sync fetches a managed CPython matching requires-python (>=3.14,<3.15). That downloaded interpreter is a generic, dynamically-linked ELF — which NixOS cannot execute out of the box (no /lib ld-linux, see https://nix.dev/permalink/stub-ld). uv sync therefore aborts and just init exits non-zero.

The dev-shell itself loads fine; only the project-venv bootstrap (uv sync) is broken, and only on NixOS hosts. FHS hosts (Ubuntu, etc.) are unaffected because they can run the downloaded interpreter.

Sub-issue of #625 (Nix migration master). Surfaced while testing onboarding on a NixOS host.

Steps to Reproduce

On a NixOS host:

  1. git checkout feature/625-nix-claude-migration
  2. direnv allow (dev-shell loads: devcontainer dev environment loaded (nix))
  3. just init

Expected Behavior

just init materializes the project venv from the lockfile and completes the bootstrap on a NixOS host, the same as on FHS hosts.

Actual Behavior

ℹ  Syncing the project environment from the lockfile...
error: Querying Python at `/home/<user>/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/bin/python3.14` failed with exit status exit status: 127

[stderr]
Could not start dynamically linked executable: /home/<user>/.local/share/uv/python/cpython-3.14.6-linux-x86_64-gnu/bin/python3.14
NixOS cannot run dynamically linked executables intended for generic
linux environments out of the box. For more information, see:
https://nix.dev/permalink/stub-ld
✗  Failed to sync project dependencies
error: recipe `init` failed on line 62 with exit code 1

Environment

  • OS: NixOS (host running the dev-shell directly via direnv, not the container)
  • Provisioning: Nix flake dev-shell (direnv allow / nix develop)
  • Branch: feature/625-nix-claude-migration
  • Architecture: x86_64

Additional Context

Possible Solution

Have the dev-shell use a Nix-provided interpreter instead of (or in addition to) a downloaded managed CPython, mirroring the image path so it works on NixOS and FHS hosts alike. For example, in mkProjectShell provide a Nix CPython (matching requires-python) and set UV_PYTHON to it with UV_PYTHON_DOWNLOADS=never, so uv sync resolves the store interpreter rather than fetching a generic one. Must remain compatible with non-NixOS hosts. (One implementer to confirm the exact approach vs. relying on the host's nixpkgs python.)

Acceptance Criteria

  • just init completes successfully on a NixOS host (dev-shell path), with the project venv materialized from the lockfile.
  • Onboarding remains working on FHS hosts (no regression).
  • No generic dynamically-linked CPython is downloaded by uv sync in the dev-shell on NixOS.
  • TDD compliance (see .claude/skills/tdd/SKILL.md)

Changelog Category: Fixed

Activity

  1. added
    bug
    priority:high
    area:workspace
    effort:medium
    semver:patch
    on Jun 24, 2026
  2. c-vigo commented on Jun 30, 2026

    @c-vigo
    ContributorAuthor

    Resolved by #684 (c9e119b) on the Nix-migration branch (epic #625, PR #670). Closing as part of post-merge backlog hygiene (#677).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workspacebugeffort:mediumpriority:highsemver:patch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions