Implement --raw for nix-instantiate --eval#12119
Conversation
e21f5e4 to
945098b
Compare
roberth
left a comment
There was a problem hiding this comment.
Document the newline behavior, then lgtm!
| if (output == okXML) | ||
| if (output == okRaw) | ||
| std::cout << *state.coerceToString(noPos, vRes, context, "while generating the nix-instantiate output"); | ||
| // We intentionally don't output a newline here. The default PS1 for Bash in NixOS starts with a newline |
There was a problem hiding this comment.
newline
This should be documented in the manual, perhaps without the reasoning.
There was a problem hiding this comment.
idea (no action required)
--lines to allow multiple arguments and stream them to stdout, each on their own line. This would always add a newline, so --raw --lines would output a line. Perhaps also implicitly flattening lists as well, printing a line for each item.
There was a problem hiding this comment.
I mentioned the absence of a trailing newline in the manual.
945098b to
cba7b66
Compare
|
@mergify queue |
✅ The pull request has been merged automaticallyDetailsThe pull request has been merged automatically at 18f0770 |
|
I think the CI workflow is still awaiting approval. |
|
I'm not super in favor of adding functionality to the legacy CLI that already exists in the new CLI. It does add a bunch of (essentially superfluous) code that we'll need to maintain indefinitely. |
|
I hear you. Until we have stabilized the new CLI, users will have unmet needs on the old CLI for use in Nixpkgs etc, which rightfully has a policy of avoiding the experimental CLI. This allows us to apply learned insights to the new CLI without as much risk. |
The experimental `nix eval` command already supports a `--raw` flag.
This commit implements the same flag for the stable nix-instantiate command.
Until now instructions and scripts that didn't want to rely on experimental
features had to use workarounds such as:
nix-instantiate --eval <something> | tr -d \"
(which also undesirably also removes double quotation marks within the string), or
nix-instantiate --eval <something> | jq -j
(which undesirably depends on another package).
Co-authored-by: Silvan Mosberger <[email protected]>
cba7b66 to
7a8a286
Compare
|
(fixed YAML syntax error in release note frontmatter) |
Didn't have the button for it until I switched back out of the new commit status view beta! (" ✨ Try the new merge experience") |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation
The experimental
nix evalcommand already supports a--rawflag.This commit implements the same flag for the stable nix-instantiate command.
Until now instructions and scripts that didn't want to rely on experimental
features had to use workarounds such as:
(which also undesirably also removes double quotation marks within the string), or
(which undesirably depends on another package).
Context
Continuation of #9361.
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.