diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/install-with-disko | 15 |
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 |