Skip to content

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

@cole-h

Description

@cole-h

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.settingsSettings, global flags, nix.conf
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions