-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
UXThe way in which users interact with Nix. Higher level than UI.The way in which users interact with Nix. Higher level than UI.featureFeature request or proposalFeature request or proposalnew-cliRelating to the "nix" commandRelating to the "nix" command
Description
Is your feature request related to a problem?
We tend to use attribute paths to refer to attributes, like packages.x86_64-linux.default, and we do so in the expression language, but also outside of it with an ad hoc syntax. Problems:
- The ad hoc attribute path syntax has not been formalized.
- It's unclear how a different tool should parse it.
- It's unclear how a different tool should generate it.
- It may be unclear whether it embeds verbatim into other syntaxes (e.g. can it contain a
%?). I assume all symbols are valid and escaping attribute paths in URLs etc should always be done.
- We don't have C++ functions for parsing or generating this format.
- It's undocumented and it doesn't have a name.
- It can't access list items
Proposed solution
Formalize "Nix Pointer", analogous to JSON pointer, but with a syntax that aligns with our conventions.
- no
/but.for selection (breaking from JSON pointer and XPointer) - Nix expression language-compatible quoting for attribute names
- Attribute-only Nix pointers are valid select-expressions when prefixed with the string
v.
Alternative solutions
Additional context
We may want to bring a syntax for list selection into the Nix expression language so that all Nix pointers are valid expressions when prefixed with v. or some similar rule.
Checklist
- checked latest Nix manual (source)
- checked open feature issues and pull requests for possible duplicates
Add 👍 to issues you find important.
reo101, a-kenji, bew and trueNAHO
Metadata
Metadata
Assignees
Labels
UXThe way in which users interact with Nix. Higher level than UI.The way in which users interact with Nix. Higher level than UI.featureFeature request or proposalFeature request or proposalnew-cliRelating to the "nix" commandRelating to the "nix" command