Skip to content

Conversation

@Ericson2314
Copy link
Member

Motivation

Big progress on #5603

Context

This is analogous to 52bfccf for EvalSettings, and 3fc77f2 for FlakeSettings and fetchers::Settings.


Add 👍 to pull requests you find important.

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

@Ericson2314 Ericson2314 marked this pull request as draft November 21, 2025 20:24
@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority store Issues and pull requests concerning the Nix store repl The Read Eval Print Loop, "nix repl" command and debugger fetching Networking with the outside (non-Nix) world, input locking c api Nix as a C library with a stable interface labels Nov 21, 2025
@edolstra
Copy link
Member

C++ isn't Haskell. It's fine to use global variables for global settings. Passing down settings objects everywhere is very annoying.

@Ericson2314
Copy link
Member Author

So the intent is that the next step would be able to write a bunch more structs, breaking up Settings into the relevant options that individual components need,

That would in turn inform us about:

  1. How new JSON settings should be structured hierarchically. We don't want to continue overwhelming the user with a giant flat unstructured namespace of settings
  2. What CLI command should get what flags. We don't want to continue spamming CLI commands with tons of irrelevant flags.

@edolstra
Copy link
Member

So the intent is that the next step would be able to write a bunch more structs, breaking up Settings into the relevant options that individual components need,

That makes it worse. I really don't want to pass a dozen of Settings objects around to function at the top of the call stack...

How new JSON settings should be structured hierarchically. We don't want to continue overwhelming the user with a giant flat unstructured namespace of settings

That can be done without this (e.g. by allowing dots in the setting name), and in any case it's unclear how much utility this has in practice.

What CLI command should get what flags. We don't want to continue spamming CLI commands with tons of irrelevant flags.

Settings are already excluded from tab completion for --, and they're not shown in the man pages.

So the only change would be that --<setting> will fail if a setting does not apply to a command, but I'm not even sure how desirable that is for global settings.

This is analogous to 52bfccf for
`EvalSettings`, and 3fc77f2 for
`FlakeSettings` and `fetchers::Settings`.
@Ericson2314 Ericson2314 force-pushed the settings-global-downstream branch from f0a2037 to 1c53a04 Compare November 25, 2025 22:24
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 fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger store Issues and pull requests concerning the Nix store with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants