aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nix/main.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index d78312944..f008ea2b7 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -369,6 +369,13 @@ void mainWrapped(int argc, char * * argv)
&& args.command->first != "upgrade-nix")
settings.requireExperimentalFeature(Xp::NixCommand);
+ if (args.command->first == "show-config") {
+ // show-config must run before any settings are modified so that it outputs the defaults
+ args.command->second->prepare();
+ args.command->second->run();
+ return;
+ }
+
if (args.useNet && !haveInternet()) {
warn("you don't have Internet access; disabling some network-dependent features");
args.useNet = false;