Update install
This commit is contained in:
parent
e44a8fd148
commit
a577db1cc2
1 changed files with 4 additions and 4 deletions
|
@ -11,6 +11,7 @@ if [ "$(id -u)" -eq 0 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -p "Include wallpapers? [y/N]" -n 1 -r
|
read -p "Include wallpapers? [y/N]" -n 1 -r
|
||||||
|
echo ""
|
||||||
|
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
if [ ! -d "/tmp/nixos/git/.git" ]; then
|
if [ ! -d "/tmp/nixos/git/.git" ]; then
|
||||||
|
@ -48,7 +49,8 @@ if [ ! -e "nixos/hosts/$TARGET_HOST/disks.nix" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create a key for encrypted swap, if needed
|
# 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 "WARNING! The disks in $TARGET_HOST are about to get wiped"
|
||||||
echo " NixOS will be re-installed"
|
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
|
# If there is a keyfile for a data disk, put copy it to the root partition and
|
||||||
# ensure the permissions are set appropriately.
|
# ensure the permissions are set appropriately.
|
||||||
if [[ -f "/tmp/swap.key" ]]; then
|
if [[ -f "/tmp/swap.key" ]]; then
|
||||||
sudo cp /tmp/swap.key /mnt/etc/swap.key
|
sudo cp /mnt-root/etc/swap.key /mnt/etc/swap.key
|
||||||
sudo cp /tmp/swap.key /mnt/tmp/swap.key
|
|
||||||
sudo chmod 0400 /mnt/etc/swap.key
|
sudo chmod 0400 /mnt/etc/swap.key
|
||||||
sudo chmod 0400 /mnt/tmp/swap.key
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
Loading…
Reference in a new issue