nix icon indicating copy to clipboard operation
nix copied to clipboard

Implement --raw for nix-instantiate --eval

Open infinisil opened this issue 2 years ago • 4 comments

Motivation

For ages now I've been doing hacks like

nix-instantiate --eval <something> | tr -d \"
# Or
nix-instantiate --eval <something> | jq -r .

to get to the raw string content in the stable CLI.

Today I've had enough and went on to implement --raw within like 10 minutes and only a single compilation error.

Context

nix eval already supports --raw.

Implements --raw for nix-instantiate:

$ nix-instantiate --eval --raw --expr '"hello"'
hello

Not yet documented or tested.

On one hand the Nix team might be inclined to reject this because it changes the old CLI when you're trying to focus on the new one.

On the other hand, this is a 6 line change..

Priorities

Add :+1: to pull requests you find important.

infinisil avatar Nov 16 '23 06:11 infinisil

This seems fine to me.

On one hand the Nix team might be inclined to reject this because it changes the old CLI when you're trying to focus on the new one.

I think while we shouldn't prioritize these things, if someone is willing to put in the work we shouldn't stop them either.

Ericson2314 avatar Nov 16 '23 15:11 Ericson2314

I agree with John, but also I would use this.

roberth avatar Nov 17 '23 11:11 roberth

See, now we're even discussing the new CLI, which actually is a priority.

roberth avatar Nov 17 '23 11:11 roberth

This would improve the documentation as well

  • https://github.com/NixOS/nix/pull/10708#discussion_r1606810865

@infinisil are you still interested in completing this PR?

roberth avatar May 20 '24 13:05 roberth

Interested yes, but not sufficient availability right now :)

I think this would be a great to label/advertise as a first good issue :)

infinisil avatar Aug 07 '24 02:08 infinisil

As discussed in #dev:nixos.org I went ahead and picked this up in #12119.

not-my-profile avatar Dec 31 '24 13:12 not-my-profile

@not-my-profile Thank you! ❤️

infinisil avatar Dec 31 '24 13:12 infinisil