mirror of
https://github.com/NixOS/nix
synced 2025-07-07 18:31:49 +02:00
feat(nix-instantiate): add --raw flag
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 <silvan.mosberger@tweag.io>
This commit is contained in:
parent
1a402e0c53
commit
7a8a28629c
5 changed files with 24 additions and 4 deletions
|
@ -84,7 +84,7 @@ When using public key authentication, you can avoid typing the passphrase with `
|
|||
> Copy GNU Hello from a remote machine using a known store path, and run it:
|
||||
>
|
||||
> ```shell-session
|
||||
> $ storePath="$(nix-instantiate --eval '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello.outPath | tr -d '"')"
|
||||
> $ storePath="$(nix-instantiate --eval --raw '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello.outPath)"
|
||||
> $ nix-copy-closure --from alice@itchy.example.org "$storePath"
|
||||
> $ "$storePath"/bin/hello
|
||||
> Hello, world!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue