Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings aliases are not supported as flags, while their "real" names are #10989

Closed
cole-h opened this issue Jun 28, 2024 · 1 comment · Fixed by #11142
Closed

Settings aliases are not supported as flags, while their "real" names are #10989

cole-h opened this issue Jun 28, 2024 · 1 comment · Fixed by #11142
Labels
bug idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. settings Settings, global flags, nix.conf

Comments

@cole-h
Copy link
Member

cole-h commented Jun 28, 2024

Describe the bug

It is possible to specify nix.conf options on the command line with --<option name> <option value if necessary> (as opposed to --option <option name> <option value if necessary>). However, this does not appear to extend to aliases.

When running nix eval --expr '{}' --build-cores 0, the --build-cores flag is unrecognized. However, passing it as an --option allows it to work.

Steps To Reproduce

  1. Install Nix 2.23.1
  2. Run nix eval --expr '{}' --build-cores 0
  3. See error that build-cores is not recognized (despite there being an alias to it from cores)
  4. Try again with --cores 0 and see it succeed

This is reproducible for all settings with aliases.

Expected behavior

Aliases of nix.conf settings should work when passed as a flag, without needing to resort to --option <setting alias name> <value>

nix-env --version output

Reproduced on nix-env (Nix) 2.21.2, nix-env (Nix) 2.23.1, and nix-env (Nix) 2.24.0pre20240617_daf1b6b

Additional context

Priorities

Add 👍 to issues you find important.

@cole-h cole-h added the bug label Jun 28, 2024
@roberth roberth added settings Settings, global flags, nix.conf idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. labels Jun 29, 2024
@roberth
Copy link
Member

roberth commented Jul 3, 2024

Triage (Nix team):

Looks like a legitimate missing piece of logic.
We have an issue where we're able to pass -- flags for options that aren't relevant, but that's a separate issue and not a reason to block a fix for aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. settings Settings, global flags, nix.conf
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants