chore: unify CLI and backend on a single nixpkgs pin - #303
Open
FrameAutomata wants to merge 1 commit into
Open
Conversation
FrameAutomata
force-pushed
the
chore/unify-nixpkgs-input
branch
from
August 25, 2026 16:52
3f5f759 to
2c46c0c
Compare
cli/flake.nix and the root flake declared the identical input (github:NixOS/nixpkgs/nixos-unstable) but carried locks generated ~94 days apart, so the CLI built against go 1.26.3 and the backend against 1.26.5. Two sibling flakes cannot share a lock -- `follows` only redirects a flake's own transitive inputs -- so the CLI's flake is removed and cli/.envrc now points at the root flake's `cli` shell. Nix resolves a bare `nix develop` up to the enclosing git root, so the ~60 existing `nix develop` invocations under cli/ (README, docs, plan docs, the integration-test skill) keep working without edits. To keep that a superset rather than a downgrade, gomodifytags and impl move into the root shell's Go tooling. The `cli` shell is its own derivation rather than an alias of `backend`: they carry the same packages, but an alias would announce itself as "backend" and print backend run commands to someone who entered it from cli/. cli/.envrc watches ../flake.nix and ../flake.lock explicitly: direnv's use_flake watches ./flake.nix and ./flake.lock relative to the .envrc's own directory, and those are exactly the two files this commit deletes, so without the explicit watches the CLI environment would go stale whenever the root flake changed. Verified under the unified shell: `just build` produces bin/traceway and `just test` passes all 322 tests. Behaviour change: the CLI shell no longer sets GOPATH/GOCACHE/GOBIN to cli/.go, so the CLI shares the default module cache. An existing cli/.go is now dead weight and can be deleted; cli/.gitignore still covers it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
FrameAutomata
force-pushed
the
chore/unify-nixpkgs-input
branch
from
August 25, 2026 20:15
2c46c0c to
34e89fc
Compare
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.
Why
cli/flake.nixand the root flake declared the identical input (github:NixOS/nixpkgs/nixos-unstable) but carried locks generated ~94 days apart, so the CLI built against go 1.26.3 and the backend against 1.26.5.Two sibling flakes cannot share a lock —
followsonly redirects a flake's own transitive inputs, and apath:..input would copy the whole tracked repo into the store. So the CLI's flake is removed andcli/.envrctargets the root flake'sclishell.The ~60 existing call sites keep working
Nix resolves a bare
nix developup to the enclosing git root (verified). Socli/README.md,docs/pages/learn/cli.mdx, the plan docs, andcli/.claude/skills/integration-test/SKILL.mdneed no edits.gomodifytagsandimplmove into the root shell so it stays a superset rather than a downgrade.cli/README.mdis updated to prefernix develop ..#cli, and notes that a barenix developstill works but lands in the heavierdefaultshell.The
clishell is its own derivationIt carries the same packages as
backend, but aliasing would make it announce itself as"backend"and print backend run commands to someone who entered it fromcli/.The watch-file subtlety
cli/.envrcwatches../flake.nixand../flake.lockexplicitly. direnv'suse_flakedoeswatch_file flake.nixrelative to the.envrc's own directory — i.e. exactly the two files this PR deletes. Without the explicit watches the CLI environment silently goes stale whenever the root flake changes.Verification
Under the unified shell, from inside
cli/:just buildproduces a workingbin/traceway, andjust testpasses 322/322.Behaviour change
The CLI shell no longer pins
GOPATH/GOCACHE/GOBINtocli/.go; it shares the default module cache. Keeping the isolation would have meant barenix developand direnv giving different shells in the same directory. An existingcli/.gois now dead weight (~205MB) and can be deleted —cli/.gitignorestill covers it.Pre-existing, not touched
just checkis already red onmain— 19 issues (16errcheck, 3staticcheck). There is no.golangci.ymlincli/, so those are just the default linters firing, and no CI workflow runs the gate despite CLAUDE.md calling it the pre-commit gate. Worth its own PR: settle the lint policy, fix what survives it, then wire it into CI.🤖 Generated with Claude Code