Skip to content

Commit 90a51e8

Browse files
authored
Merge pull request #456 from Qubasa/main
--debug enables --show-trace on nix build commands
2 parents d4a3ecf + 73b77b1 commit 90a51e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/nixos-anywhere.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ flakeAttr=""
77
kexecUrl=""
88
kexecExtraFlags=""
99
enableDebug=""
10+
nixBuildFlags=""
1011
diskoScript=""
1112
diskoMode="disko"
1213
nixosSystem=""
@@ -106,6 +107,8 @@ Options:
106107
disable passing --substitute-on-destination to nix-copy
107108
* --debug
108109
enable debug output
110+
* --show-trace
111+
show nix build traces
109112
* --option <key> <value>
110113
nix option to pass to every nix related command
111114
* --from <store-uri>
@@ -212,6 +215,9 @@ parseArgs() {
212215
--copy-host-keys)
213216
copyHostKeys=y
214217
;;
218+
--show-trace)
219+
nixBuildFlags+=" --show-trace"
220+
;;
215221
--debug)
216222
enableDebug="-x"
217223
printBuildLogs=y
@@ -353,6 +359,7 @@ nixBuild() {
353359
NIX_SSHOPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $sshKeyDir/nixos-anywhere ${sshArgs[*]}" nix build \
354360
--print-out-paths \
355361
--no-link \
362+
"$nixBuildFlags" \
356363
"${nixOptions[@]}" \
357364
"$@"
358365
}
@@ -380,6 +387,7 @@ runVmTest() {
380387
--print-out-paths \
381388
--no-link \
382389
-L \
390+
"$nixBuildFlags" \
383391
"${nixOptions[@]}" \
384392
"${flake}#${flakeAttr}.system.build.installTest"
385393
}

0 commit comments

Comments
 (0)