Skip to content

Support specifying --store and --eval-store - #682

Open
ShamrockLee wants to merge 4 commits into
Mic92:mainfrom
ShamrockLee:feature/store-support
Open

Support specifying --store and --eval-store#682
ShamrockLee wants to merge 4 commits into
Mic92:mainfrom
ShamrockLee:feature/store-support

Conversation

@ShamrockLee

@ShamrockLee ShamrockLee commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Allow nixpkgs-review to run in an alternative Nix store.

Note:

I'm also adding support to specify custom Nix configuration via a Nix-like --option flag as a parallel effort in a local feature branch.

Since there's no --option alternative for --eval-store (aside from --option store <alternative store>), standalone --store and --eval-store flags would still help.

Assisted-by: claude-code: claude-opus-4.8, claude-sonnet-4.6

Reviews always built into the ambient /nix/store.
This is a prerequisite for isolating experimental builds (e.g.
ca-derivations, which has known store-corruption bugs) from the
user's main store.

--store is passed through to every store-touching nix call and is
a no-op when unset.
The review shell warns but still attempts to launch with a custom
store, since built binaries won't be at the real /nix/store path.

Assisted-by: claude-code: claude-opus-4.8, claude-sonnet-4.6
Remote/slow build stores (e.g. nixbuild.net) recommend keeping
evaluation on a local store while builds go elsewhere.
--store alone couldn't express that split.

--eval-store is passed through wherever evaluation happens (eval,
instantiate, nix build's own eval, the review shell); pure store
queries (verify, log) are unaffected since they don't evaluate.

Assisted-by: claude-code: claude-opus-4.8, claude-sonnet-4.6
The test called build_config_from_args() directly.
That shells out to a real `nix eval` for current_system(),
with no environment isolation,
unlike tests that use the helpers.nixpkgs() fixture.

This passed in an interactive dev shell.
It failed in a Nix build sandbox: no writable profile dir,
so `nix eval` itself errors out.

The test only cares about --store/--eval-store threading.
Mock current_system() instead of depending on ambient Nix state.

Assisted-by: claude-code: claude-opus-4.8, claude-sonnet-4.6
list_packages()'s nix-env call computed base-vs-merged output
paths without --store/--eval-store.
Harmless without --allow ifd, but with IFD enabled it could build
into the real /nix/store despite an isolated --store being set.

Assisted-by: claude-code: claude-opus-4.8, claude-sonnet-4.6
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