Skip to content

Stabilize the (non-flakes) installable syntax #10046

@thufschmitt

Description

@thufschmitt

Part of #7701.

The syntax for non-flakes installables isn't optimal, and probably not exactly what we want to stabilize.
After considering various options and asking about them, we settled on the second one, namely:

  • By default, positional arguments are not allowed on the command-line (or parsed as flake references when flakes are enabled)
  • After encountering --file /some/file.nix, the CLI parser interprets every positional argument as an attribute path in import /some/file.nix until the next --file/--expr(/--flake) argument
  • After encountering --expr e, the CLI parser interprets every positional argument as an attribute path in the nix expression e until the next --file/--expr(/--flake) argument
  • (After encountering --flake, the CLI parser interprets every positional argument as a flake reference until the next --file/--expr/--flake argument)

with the parenthesized bits corresponding to the behaviour with flakes enabled.

This new behaviour is open for implementation to anyone who would want to give it a stab.

Metadata

Metadata

Assignees

No one assigned

    Labels

    idea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.new-cliRelating to the "nix" command

    Type

    No type

    Projects

    Status

    Defined work

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions