aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMark Nipper <nipsy@bitgnome.net>2024-04-15 23:57:01 -0700
committerMark Nipper <nipsy@bitgnome.net>2024-04-15 23:57:01 -0700
commitae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde (patch)
treea82cd06ccdd8bd0803af4ecc41da03750f2c4a20 /scripts
parent624c07e8680501a00b3edd45476a6380127aaad7 (diff)
downloadnix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar
nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.gz
nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.bz2
nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.lz
nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.xz
nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.tar.zst
nix-ae7994f09eb10c6bb3a26cfbad9b9b6ec7ad9dde.zip
Update disko installer and finalize VM configuration
Diffstat (limited to '')
-rwxr-xr-xscripts/install-with-disko15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/install-with-disko b/scripts/install-with-disko
index 4a89676..7ae4e8e 100755
--- a/scripts/install-with-disko
+++ b/scripts/install-with-disko
@@ -5,7 +5,6 @@ setopt ERR_EXIT NO_UNSET PIPE_FAIL
DIR="${0:h}"
TARGET_HOST="${1:-}"
-TARGET_USER="${2:-nipsy}"
if [[ "${USERNAME}" != "nixos" ]]; then
echo "ERROR! ${0:t} should be run as the nixos user from a NixOS installer." >&2
@@ -78,8 +77,22 @@ if [[ "${REPLY}" == "y" ]]; then
if [[ "${?}" -eq 0 ]]; then
cd
+
+ for i in $(awk -F: '{if ($3 >= 1000 && $3 <= 30000) print $1}' /mnt/etc/passwd); do
+ read -q "?Do you want to set a password for the user ${i}? [y/N] "
+ echo
+ if [[ "${REPLY}" == "y" ]]; then
+ sudo chroot /mnt /$(find /mnt/nix/store/*-shadow-*/bin/passwd -executable -name passwd | cut -d/ -f3-) ${i}
+ fi
+ echo
+ done
+
+ echo 'Unmounting file systems...' >&2
mount | grep -v zfs | awk '$3 ~ /^\/mnt\// {print $3}' | xargs -i{} sudo umount -lf {}
+ echo 'Unmounting ZFS file systems...' >&2
while ! sudo umount -t zfs -a; do echo 'attempting to umount all ZFS file systems' >&2; sleep 1; done
+ echo 'Exporting zpool...' >&2
while ! sudo zpool export -a; do echo 'attempting to export all zpools' >&2; sleep 1; done
+ echo 'Type reboot when ready.' >&2
fi
fi