Skip to content

feat(scripts): make just init Nix-first; retire requirements.yaml - #672

Merged
c-vigo merged 2 commits into
feature/625-nix-claude-migrationfrom
feature/671-nix-first-just-init
Jun 24, 2026
Merged

c-vigo merged 2 commits into
feature/625-nix-claude-migrationfrom
feature/671-nix-first-just-init

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description

Make just init Nix-first and retire scripts/requirements.yaml, closing a gap
in the #625 migration: the contributor bootstrap was still a multi-OS package
installer driven by a second toolchain SSoT (requirements.yaml) that had
drifted from flake.nix devTools.

Type of Change

  • feat -- New feature
  • refactor -- Code restructuring (no behavior change)

Changes Made

  • scripts/init.sh: rewritten from a ~680-line OS-detecting installer into a
    Nix-first prerequisite gate + project bootstrapper. It requires Nix (and
    direnv, unless --no-direnv) plus the dev-shell toolchain, then runs one-time,
    idempotent bootstrap (uv sync --frozen --all-extras, git hooks path, commit
    template, pre-commit install-hooks) with advisory podman info / gh auth status checks. It installs no tools — the toolchain is the flake's devTools —
    and short-circuits inside the built image (IN_CONTAINER=true). The gate path
    uses only shell builtins so it works before any tool is on PATH.
  • Retired scripts/requirements.yaml and its docs/generate.py consumers
    (load_requirements, format_requirements_table, format_install_commands)
    and their tests. flake.nix devTools is now the sole toolchain SSoT.
  • Docs: CONTRIBUTE.md.j2 "Requirements" table → "Prerequisites: Nix +
    direnv + a working host container runtime (podman/Docker)". Regenerated
    CONTRIBUTE.md/README.md; updated the justfile init recipe comment.

Changelog Entry

Changed

  • Make just init Nix-first (#671)

Removed

  • Retire scripts/requirements.yaml (#671)

Testing

  • Tests pass locally (full bats tests/bats/ = 243/243; pytest tests/test_utils.py tests/test_install_script.py = 52 passed; ruff check clean; all pre-commit hooks pass incl. shellcheck + generate-docs sync)
  • Manual testing performed (below)

Manual Testing Details

  • init.sh --help prints usage; unknown flags exit 1.
  • With an empty PATH the Nix gate fires with installer + flakes + Cachix guidance and exits non-zero.
  • With nix present but no uv, it instructs direnv allow / nix develop and exits non-zero.
  • IN_CONTAINER=true ./scripts/init.sh is a no-op.
  • ./scripts/init.sh --check in a provisioned dev shell reports prerequisites OK without bootstrapping.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated the documentation accordingly (edited docs/templates/, ran just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests (TDD: failing init.bats first, then implementation)
  • New and existing unit tests pass locally with my changes

Closes #671

c-vigo added 2 commits June 24, 2026 11:33
Rewrite init.bats to assert the new contract — gate on Nix/direnv and the
dev-shell, bootstrap the project, and no legacy OS installer — and drop the
requirements.yaml test classes from test_utils.py.

Refs: #671
Rework scripts/init.sh from a ~680-line multi-OS package installer into a
Nix-first gate + project bootstrapper: it requires Nix (and direnv, unless
--no-direnv) plus the dev-shell toolchain, then runs one-time, idempotent
bootstrap (uv sync, git hooks path, commit template, pre-commit install-hooks)
with advisory podman/gh checks. It installs no tools — the toolchain is the
flake's devTools — and short-circuits inside the built image (IN_CONTAINER).

Retire scripts/requirements.yaml, the redundant second toolchain SSoT that had
drifted from flake.nix devTools: drop its docs/generate.py consumers
(load_requirements / format_requirements_table / format_install_commands) and
rewrite the CONTRIBUTE.md 'Requirements' table into a 'Prerequisites: Nix +
direnv + host container runtime' section. Update the justfile init recipe
comment and regenerate the docs.

Refs: #671
@c-vigo
c-vigo merged commit 7c8930a into feature/625-nix-claude-migration Jun 24, 2026
10 checks passed
@c-vigo
c-vigo deleted the feature/671-nix-first-just-init branch June 24, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant