You signed in with another tab or window. Reload to re
8000
fresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Settings: merge session-level eval, fetch and flake defaults #36
Session-scoped defaults exist for stores and for nothing else.
Evidence
resolve_store_spec (nanopynix/src/nanopynix/stores.py:529) merges NixStoreDefaults under a store model, and both engines call it. There is no
equivalent for the evaluator, fetcher or flake settings. EvalSession.open on both engines reads the per-evaluator argument only.
A caller who wants every evaluator in a session to be pure must repeat eval_settings= at every session.eval(...) call. There is no way to state
it once.
Scope
Write one merge helper, and use it four times:
defmerge_defaults[M: NixConfigModel](spec: M|None, defaults: M|None) ->M|None:
"""Fill the fields ``spec`` did not set from ``defaults``. A set field wins."""
resolve_store_spec becomes its store-shaped caller. Session.eval, Session.repl, EvalSession.lock_flake and EvalSession.eval_flake become
the other three.
Low. A field set on the call always wins, so nothing that works today changes.
Acceptance criteria
A session opened with pure_eval=True produces a pure evaluator from a bare session.eval(store). A per-call eval_settings=NixEvalSettings(pure_eval=False) overrides the default.
Tests
Two cases for each scope, on both engines: the default applies, and the
override wins.
Activity
fix(settings): route each scope to the Nix door that accepts it