aboutsummaryrefslogtreecommitdiff
path: root/src/nix/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r--src/nix/build.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 65708e98b..67be4024b 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -5,9 +5,11 @@
#include "store-api.hh"
#include "local-fs-store.hh"
+#include <nlohmann/json.hpp>
+
using namespace nix;
-struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
+struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
{
Path outLink = "result";
BuildMode buildMode = bmNormal;
@@ -86,6 +88,8 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixProfile
}, buildables[i]);
updateProfile(buildables);
+
+ if (json) logger->cout("%s", buildablesToJSON(buildables, store).dump());
}
};