aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorFélix Baylac-Jacqué <felix@alternativebit.fr>2021-04-27 10:44:29 +0200
committerFélix Baylac-Jacqué <felix@alternativebit.fr>2021-04-27 11:28:47 +0200
commit7dca9c24c4acdf2e2abe0f6a138b734701098cc6 (patch)
treee4bcadd6635439b262130028910a842698a56f14 /src/nix
parentfe2bf464cf1cdbed11d4a38f063c4f8b1c922a48 (diff)
nix build: make dry-run to print a json output if --json is enabled
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/build.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 03159b6cc..226c551fa 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -54,6 +54,8 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
{
auto buildables = build(store, dryRun ? Realise::Nothing : Realise::Outputs, installables, buildMode);
+ if (json) logger->cout("%s", derivedPathsWithHintsToJSON(buildables, store).dump());
+
if (dryRun) return;
if (outLink != "")
@@ -79,8 +81,6 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
}
updateProfile(buildables);
-
- if (json) logger->cout("%s", derivedPathsWithHintsToJSON(buildables, store).dump());
}
};