diff --git a/docs/install.sh b/docs/install.sh index c0b678a9..bc17cef5 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -38,7 +38,7 @@ if [ ! -e "nixos/hosts/$TARGET_HOST/disks.nix" ]; then fi # Create a key for encrypted swap, if needed -sudo echo -n "$(head -c32 /dev/random | base64)" > /etc/swap.key +echo -n "$(head -c32 /dev/random | base64)" > /tmp/swap.key echo "WARNING! The disks in $TARGET_HOST are about to get wiped" echo " NixOS will be re-installed" @@ -66,8 +66,8 @@ 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 "/etc/swap.key" ]]; then - sudo cp /etc/swap.key /mnt/etc/swap.key - sudo chmod 0400 /mnt/etc/swap.key + if [[ -f "/tmp/swap.key" ]]; then + sudo cp /tmp/swap.key /mnt/tmp/swap.key + sudo chmod 0400 /mnt/tmp/swap.key fi fi \ No newline at end of file diff --git a/nixos/hosts/nixos-framework/disks.nix b/nixos/hosts/nixos-framework/disks.nix index 3461e96b..c55fb202 100644 --- a/nixos/hosts/nixos-framework/disks.nix +++ b/nixos/hosts/nixos-framework/disks.nix @@ -72,7 +72,7 @@ type = "luks"; name = "SWAP"; settings = { - keyFile = "/etc/swap.key"; + keyFile = "/tmp/swap.key"; allowDiscards = true; }; content = {