diff options
Diffstat (limited to 'bootstrap/01_install')
-rwxr-xr-x | bootstrap/01_install | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/bootstrap/01_install b/bootstrap/01_install index 5a3acc2d..2c8fa108 100755 --- a/bootstrap/01_install +++ b/bootstrap/01_install @@ -5,8 +5,24 @@ SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH INSTALL=y . %SCRIPT_ENSURE_CONFIG_VARIABLES -msg "started creating filesystem..." -nix run github:nix-community/disko -- --flake "git+https://codeberg.org/soispha/nixos-config#$NIX_HOST" --mode disko +msg "Important information:" +msg2 "Choose disk id is: $NIX_DISK"; +warning "This information needs to be entered in the host configuration BEFORE rebuilding it. Otherwise you'll have to wait for a 1 h cooldown!" +info_applied=false; +while [ "$info_applied" = false ];do + readp "Have you updated your chosen host with the choose disk id? [N/y]: " result + case $result in + [Yy]) + info_applied=true; + ;; + *) + warning "You won't be able to boot, if you don't update it!" + ;; + esac +done + +msg "Started creating filesystem..." +nix run github:nix-community/disko -- --flake "git+https://codeberg.org/soispha/nixos-config#$NIX_HOST" --mode disko --experimental-features 'nix-command flakes'; msg "Finished mounting and generating btrfs subvolumes" msg "Creating swapfile..." @@ -16,8 +32,6 @@ msg "Finished creating swapfile!" msg "Important information:" msg2 "Swapfile UUID is: $(findmnt -no UUID -T /mnt/swap/swapfile)"; msg2 "Swapfile resume offset is: $(btrfs inspect-internal map-swapfile -r /mnt/swap/swapfile)"; -msg2 "Root-disk UUID is: $(lsblk -no UUID -T $DISK_ROOT)"; -msg2 "EFI-disk UUID is: $(lsblk -no UUID -T $DISK_EFI)"; warning "This information needs to be entered in the host configuration BEFORE rebuilding it. Otherwise the system won't boot!" info_applied=false; @@ -34,7 +48,7 @@ while [ "$info_applied" = false ];do done msg "Checking for incompatibilities..." -ssd_or_hdd=$(cat /sys/block/$disk/queue/rotational); +ssd_or_hdd="$(cat /sys/block/"$(basename "$(readlink -f "$NIX_DISK")" | tr -d '\n')"/queue/rotational)"; case "$ssd_or_hdd" in 0) msg2 "You seem to use a ssd." @@ -44,7 +58,7 @@ case "$ssd_or_hdd" in msg2 "Yay, your ssd supports trim, go on and activate it"; ;; "false") - msg2 "Nay, your ssd doesn't support trim, go on"; + msg2 "Nay, your ssd doesn't support trim"; ;; *) warning "Your ssd doesn't seem to exists, if this bothers you please open an issue.'"; @@ -60,13 +74,10 @@ case "$ssd_or_hdd" in esac -readp "Do you want to continue with nixos-install? [N/y]: " result -case $result in - [Yy]) +case "$INSTALL_TO_SETUP" in + "yes") nix run "git+https://codeberg.org/soispha/nixos-config#setup" --experimental-features 'nix-command flakes'; ;; *) - msg "Sure, do it yourself" - exit 1 ;; esac |