aboutsummaryrefslogtreecommitdiff
path: root/src/nix-instantiate
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2022-08-16 12:23:37 +0200
committerNaïm Favier <n@monade.li>2022-08-22 15:01:35 +0200
commit062e4fcdde145ec6780df8d1002dc7380f6eb4bf (patch)
treec644db3d62e3f1fd1f36fd47369336018fa26054 /src/nix-instantiate
parentaf4e8b00fb986acf32d7e4cd4fff7218b38958df (diff)
JSON: print paths as strings without copying them to the store
Makes `printValueAsJSON` not copy paths to the store for `nix eval --json`, `nix-instantiate --eval --json` and `nix-env --json`. Fixes https://github.com/NixOS/nix/issues/5612
Diffstat (limited to 'src/nix-instantiate')
-rw-r--r--src/nix-instantiate/nix-instantiate.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index d3144e131..6181d2190 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -53,7 +53,7 @@ void processExpr(EvalState & state, const Strings & attrPaths,
if (output == okXML)
printValueAsXML(state, strict, location, vRes, std::cout, context, noPos);
else if (output == okJSON)
- printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context);
+ printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context, false);
else {
if (strict) state.forceValueDeep(vRes);
vRes.print(state.symbols, std::cout);