aboutsummaryrefslogtreecommitdiff
path: root/src/nix/path-info.cc
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2022-11-16 16:49:49 +0100
committerYorick van Pelt <yorick@yorickvanpelt.nl>2022-11-16 16:50:50 +0100
commit09f00dd4d01aa1b6866978d162022133e521614f (patch)
tree1d7470dfc9d7bb997d684294e0048280079a11a2 /src/nix/path-info.cc
parent62960f32915909a5104f2ca3a32b25fb3cfd34c7 (diff)
Replace src/libutil/json.cc with nlohmann json generation
Diffstat (limited to 'src/nix/path-info.cc')
-rw-r--r--src/nix/path-info.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix/path-info.cc b/src/nix/path-info.cc
index d690fe594..613c5b191 100644
--- a/src/nix/path-info.cc
+++ b/src/nix/path-info.cc
@@ -1,12 +1,13 @@
#include "command.hh"
#include "shared.hh"
#include "store-api.hh"
-#include "json.hh"
#include "common-args.hh"
#include <algorithm>
#include <array>
+#include <nlohmann/json.hpp>
+
using namespace nix;
struct CmdPathInfo : StorePathsCommand, MixJSON
@@ -86,11 +87,10 @@ struct CmdPathInfo : StorePathsCommand, MixJSON
pathLen = std::max(pathLen, store->printStorePath(storePath).size());
if (json) {
- JSONPlaceholder jsonRoot(std::cout);
- store->pathInfoToJSON(jsonRoot,
+ std::cout << store->pathInfoToJSON(
// FIXME: preserve order?
StorePathSet(storePaths.begin(), storePaths.end()),
- true, showClosureSize, SRI, AllowInvalid);
+ true, showClosureSize, SRI, AllowInvalid).dump();
}
else {