Skip to content

Commit

Permalink
nixos-remote: add --skip-disko flag
Browse files Browse the repository at this point in the history
  • Loading branch information
pogobanane authored and Mic92 committed Feb 9, 2023
1 parent 74c8547 commit 84f0f43
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ Options:
do not reboot after installation, allowing further customization of the target installation.
* --kexec url
use another kexec tarball to bootstrap NixOS
* --skip-disko
dont format disks with disko
* --stop-after-disko
exit after disko formating, you can then proceed to install manually or some other way
* --extra-files files
Expand Down
13 changes: 11 additions & 2 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Options:
do not reboot after installation, allowing further customization of the target installation.
* --kexec url
use another kexec tarball to bootstrap NixOS
* --skip-disko
dont format disks with disko
* --stop-after-disko
exit after disko formating, you can then proceed to install manually or some other way
* --extra-files files
Expand Down Expand Up @@ -89,6 +91,9 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
--skip-disko)
skip_disko=y
;;
--stop-after-disko)
stop_after_disko=y
;;
Expand Down Expand Up @@ -293,8 +298,12 @@ for path in "${!disk_encryption_keys[@]}"; do
ssh_ "umask 077; cat > $path" <"${disk_encryption_keys[$path]}"
done

nix_copy --to "ssh://$ssh_connection" "$disko_script"
ssh_ "$disko_script"
if [[ ${skip_disko} == "y" ]]; then
echo "Skipping disko (partitioning)."
else
nix_copy --to "ssh://$ssh_connection" "$disko_script"
ssh_ "$disko_script"
fi

if [[ ${stop_after_disko-n} == "y" ]]; then
# Should we also do this for `--no-reboot`?
Expand Down

0 comments on commit 84f0f43

Please sign in to comment.