Skip to content

globals: make store settings private with typed accessors#15191

Closed
amaanq wants to merge 1 commit into
NixOS:masterfrom
obsidiansystems:store-reference-flags
Closed

globals: make store settings private with typed accessors#15191
amaanq wants to merge 1 commit into
NixOS:masterfrom
obsidiansystems:store-reference-flags

Conversation

@amaanq
Copy link
Copy Markdown
Member

@amaanq amaanq commented Feb 10, 2026

Motivation

The storeUri, substituters, and trustedSubstituters settings were
publicly accessible as raw strings. This commit makes them private and
adds typed accessor methods that return StoreReference values, parsing
on demand. String-level accessors are also provided for daemon
client-settings filtering where string comparison is needed.

The CLI flags (--from, --to, --eval-store, and substituter URIs in
sigs, verify, flake archive) now parse directly to
StoreReference instead of storing raw strings.

Context

This is a stepping stone towards #10761


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions Bot added new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store c api Nix as a C library with a stable interface labels Feb 10, 2026
@amaanq amaanq changed the title move package-management/terminology into glossary.md @amaanq globals: make store settings private with typed accessors Feb 10, 2026
@amaanq amaanq changed the title @amaanq globals: make store settings private with typed accessors globals: make store settings private with typed accessors Feb 10, 2026
Comment thread src/libstore/include/nix/store/globals.hh Outdated
Comment thread src/libstore/globals.cc Outdated
@amaanq amaanq force-pushed the store-reference-flags branch 3 times, most recently from 5b7ecb7 to 9b97ca4 Compare February 10, 2026 22:47
Comment thread src/libstore/include/nix/store/store-open.hh Outdated
@amaanq amaanq force-pushed the store-reference-flags branch 2 times, most recently from e3032ae to a3dca5e Compare February 10, 2026 22:54
Comment thread src/libexpr/primops/fetchClosure.cc Outdated
Comment thread src/libmain/shared.cc Outdated
.description = "The URL of the Nix store to use.",
.labels = {"store-uri"},
.handler = {&(std::string &) settings.storeUri},
.handler = {[](std::string s) { settings.set("store", s); }},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary, if we're not changing the type of the setting?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, because the field is private now, hmm

@amaanq amaanq force-pushed the store-reference-flags branch 3 times, most recently from a2f2cd9 to f9e055a Compare February 11, 2026 03:51
The `storeUri`, `substituters`, and `trustedSubstituters` settings are
now private with typed accessor methods that return `StoreReference`
values, parsing on demand. The daemon client-settings filter uses these
accessors for trusted-substituter validation.
@amaanq amaanq force-pushed the store-reference-flags branch from f9e055a to 40f8eb8 Compare February 11, 2026 03:56
@Ericson2314
Copy link
Copy Markdown
Member

Closed in favor of #15192

@amaanq amaanq deleted the store-reference-flags branch March 25, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c api Nix as a C library with a stable interface new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants