aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/install-with-disko
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2024-04-15 01:37:27 -0700
committerMark Nipper <nipsy@bitgnome.net>2024-04-15 01:37:27 -0700
commit624c07e8680501a00b3edd45476a6380127aaad7 (patch)
treef3c65be08420e77c61c5fcf312885c5ef5cd7cd0 /scripts/install-with-disko
parent853984814b50305386fa531dbc2ebb2c2c65af42 (diff)
downloadnix-624c07e8680501a00b3edd45476a6380127aaad7.tar
nix-624c07e8680501a00b3edd45476a6380127aaad7.tar.gz
nix-624c07e8680501a00b3edd45476a6380127aaad7.tar.bz2
nix-624c07e8680501a00b3edd45476a6380127aaad7.tar.lz
nix-624c07e8680501a00b3edd45476a6380127aaad7.tar.xz
nix-624c07e8680501a00b3edd45476a6380127aaad7.tar.zst
nix-624c07e8680501a00b3edd45476a6380127aaad7.zip
Split core packages more, improve installer and set richese to minimal packages for testing
Diffstat (limited to 'scripts/install-with-disko')
-rwxr-xr-xscripts/install-with-disko19
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/install-with-disko b/scripts/install-with-disko
index 859a647..4a89676 100755
--- a/scripts/install-with-disko
+++ b/scripts/install-with-disko
@@ -28,10 +28,20 @@ if grep -q "data.keyfile" "${DIR}/../hosts/${TARGET_HOST}/disks.nix"; then
while true; do
echo -en "\n${TARGET_HOST} uses ZFS encryption. Enter a passphrase to encrypt your pool: "
read -s pass
- echo -e '\n'
+ echo
if [[ "${#pass}" -lt 8 ]]; then
echo 'ERROR! Passphrase must be at least 8 characters.' >&2
+ continue
+ fi
+
+ echo -n "Re-enter passphrase: "
+ read -s pass2
+ echo -e '\n'
+
+ if [[ "${pass}" != "${pass2}" ]]; then
+ echo 'ERROR! Passphrases must match.' >&2
+ continue
else
break
fi
@@ -65,4 +75,11 @@ if [[ "${REPLY}" == "y" ]]; then
sudo rsync -a --delete --exclude .git "${DIR}/.." /mnt/etc/nixos
cd /mnt/etc/nixos
sudo nixos-install --flake ".#${TARGET_HOST}"
+
+ if [[ "${?}" -eq 0 ]]; then
+ cd
+ mount | grep -v zfs | awk '$3 ~ /^\/mnt\// {print $3}' | xargs -i{} sudo umount -lf {}
+ while ! sudo umount -t zfs -a; do echo 'attempting to umount all ZFS file systems' >&2; sleep 1; done
+ while ! sudo zpool export -a; do echo 'attempting to export all zpools' >&2; sleep 1; done
+ fi
fi