test
This commit is contained in:
parent
59b0758b9b
commit
e5c75c0f5e
2 changed files with 5 additions and 5 deletions
|
@ -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
|
|
@ -72,7 +72,7 @@
|
|||
type = "luks";
|
||||
name = "SWAP";
|
||||
settings = {
|
||||
keyFile = "/etc/swap.key";
|
||||
keyFile = "/tmp/swap.key";
|
||||
allowDiscards = true;
|
||||
};
|
||||
content = {
|
||||
|
|
Loading…
Reference in a new issue