nixos-rebuild, nixos-rebuild-ng: print the store path that was built

This commit is contained in:
r-vdp
2025-01-23 16:26:09 +01:00
parent 864f89f98b
commit f1c80ddf79
2 changed files with 9 additions and 0 deletions
@@ -502,6 +502,9 @@ def execute(argv: list[str]) -> None:
specialisation=args.specialisation,
install_bootloader=args.install_bootloader,
)
print_result("Done. The new configuration is", path_to_config)
case Action.BUILD:
print_result("Done. The new configuration is", path_to_config)
case Action.BUILD_VM | Action.BUILD_VM_WITH_BOOTLOADER:
# If you get `not-found`, please open an issue
vm_path = next(path_to_config.glob("bin/run-*-vm"), "not-found")
@@ -949,7 +949,13 @@ if [[ "$action" = switch || "$action" = boot || "$action" = test || "$action" =
if ! targetHostSudoCmd "${cmd[@]}" "$action"; then
log "warning: error(s) occurred while switching to the new configuration"
exit 1
else
echo -n "Done. The new configuration is " >&2
echo "$pathToConfig"
fi
elif [[ "$action" = build ]]; then
echo -n "Done. The new configuration is " >&2
echo "$pathToConfig"
fi