From a577db1cc24ecce377293fb6035941095a0d6f80 Mon Sep 17 00:00:00 2001 From: iFargle Date: Mon, 5 Feb 2024 22:21:09 +0900 Subject: [PATCH] Update install --- docs/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/install.sh b/docs/install.sh index 1f223d9b..c6166b8e 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -11,6 +11,7 @@ if [ "$(id -u)" -eq 0 ]; then fi read -p "Include wallpapers? [y/N]" -n 1 -r +echo "" if [[ $REPLY =~ ^[Yy]$ ]]; then if [ ! -d "/tmp/nixos/git/.git" ]; then @@ -48,7 +49,8 @@ if [ ! -e "nixos/hosts/$TARGET_HOST/disks.nix" ]; then fi # Create a key for encrypted swap, if needed -echo "$(head -c32 /dev/random | base64)" > /tmp/swap.key +sudo mkdir -p /mnt-root/etc/ +echo "$(head -c32 /dev/random | base64)" > /mnt-root/etc/swap.key echo "WARNING! The disks in $TARGET_HOST are about to get wiped" echo " NixOS will be re-installed" @@ -77,9 +79,7 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then # If there is a keyfile for a data disk, put copy it to the root partition and # ensure the permissions are set appropriately. if [[ -f "/tmp/swap.key" ]]; then - sudo cp /tmp/swap.key /mnt/etc/swap.key - sudo cp /tmp/swap.key /mnt/tmp/swap.key + sudo cp /mnt-root/etc/swap.key /mnt/etc/swap.key sudo chmod 0400 /mnt/etc/swap.key - sudo chmod 0400 /mnt/tmp/swap.key fi fi \ No newline at end of file