[Nix#9329] Practical pure eval for paths in non-Flake CLIs #102

Open
opened 2024-03-16 06:44:54 +00:00 by lix-bot · 0 comments
Member

Upstream-Issue: NixOS/nix#9329

Is your feature request related to a problem? Please describe.

It's currently impractical to evaluate local paths using --pure-eval, a stable feature.

It can be done, but it needs like 20 lines of shell code to tell Nix which local paths can be used: https://gist.github.com/infinisil/6bd89c9fb5e66b635bd30fa9ae5b7bf6#file-nix-instantiate-pure-L5-L26

This gets you more or less the same --pure-eval power as the current Flake CLI.

Describe the solution you'd like

Make --pure-eval mode practically usable for nix- and nix -f CLIs by building the above functionality into the commands directly.

This is backwards compatible, because it would only change behavior when --pure-eval is enabled and paths are passed, which currently always gives an error.

Describe alternatives you've considered

A pure evaluation primop, some brainstorming for which can be seen in https://github.com/tweag/epcb.

Additional context

Slightly related is https://github.com/NixOS/nix/issues/5868, which would allow making the shell-based implementation nicer.

Priorities

Add 👍 to issues you find important.

Upstream-Issue: https://git.lix.systems/NixOS/nix/issues/9329 **Is your feature request related to a problem? Please describe.** It's currently impractical to evaluate local paths using `--pure-eval`, a stable feature. It can be done, but it needs like 20 lines of shell code to tell Nix which local paths can be used: https://gist.github.com/infinisil/6bd89c9fb5e66b635bd30fa9ae5b7bf6#file-nix-instantiate-pure-L5-L26 This gets you more or less the same `--pure-eval` power as the current Flake CLI. **Describe the solution you'd like** Make `--pure-eval` mode practically usable for `nix-` and `nix -f` CLIs by building the above functionality into the commands directly. This is backwards compatible, because it would only change behavior when `--pure-eval` is enabled and paths are passed, which currently always gives an error. **Describe alternatives you've considered** A pure evaluation primop, some brainstorming for which can be seen in https://github.com/tweag/epcb. **Additional context** Slightly related is https://github.com/NixOS/nix/issues/5868, which would allow making the shell-based implementation nicer. **Priorities** Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
lix-bot added the
imported
label 2024-03-16 06:44:54 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#102
No description provided.