diff --git a/src/nixos-anywhere.sh b/src/nixos-anywhere.sh index fed359fa..39126b08 100755 --- a/src/nixos-anywhere.sh +++ b/src/nixos-anywhere.sh @@ -7,6 +7,7 @@ flakeAttr="" kexecUrl="" kexecExtraFlags="" enableDebug="" +nixBuildFlags="" diskoScript="" diskoMode="disko" nixosSystem="" @@ -106,6 +107,8 @@ Options: disable passing --substitute-on-destination to nix-copy * --debug enable debug output +* --show-trace + show nix build traces * --option nix option to pass to every nix related command * --from @@ -212,6 +215,9 @@ parseArgs() { --copy-host-keys) copyHostKeys=y ;; + --show-trace) + nixBuildFlags+=" --show-trace" + ;; --debug) enableDebug="-x" printBuildLogs=y @@ -353,6 +359,7 @@ nixBuild() { NIX_SSHOPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $sshKeyDir/nixos-anywhere ${sshArgs[*]}" nix build \ --print-out-paths \ --no-link \ + "$nixBuildFlags" \ "${nixOptions[@]}" \ "$@" } @@ -380,6 +387,7 @@ runVmTest() { --print-out-paths \ --no-link \ -L \ + "$nixBuildFlags" \ "${nixOptions[@]}" \ "${flake}#${flakeAttr}.system.build.installTest" }