diff --git a/install.sh b/install.sh index 2fd6892..5645e14 100644 --- a/install.sh +++ b/install.sh @@ -5,31 +5,22 @@ DISK="/dev/sda" parted $DISK -- mklabel gpt # Create the root partition -parted $DISK -- mkpart root ext4 512MiB 100% +parted $DISK -- mkpart primary ext4 512MiB 100% -parted $DISK -- mkpart ESP fat32 1MB 512MiB +# Create the EFI partition +parted $DISK -- mkpart ESP fat32 1MiB 512MiB parted $DISK -- set 2 esp on -# DO NOT FORMAT the root partition before encryption! -# cryptsetup will fail if the partition is already formatted +# Format the root partition +mkfs.ext4 ${DISK}1 -# Encrypt the root partition -cryptsetup luksFormat ${DISK}1 -cryptsetup open ${DISK}1 root - -# Now format the encrypted partition -mkfs.ext4 /dev/mapper/root - -# Mount the partitions -mount /dev/mapper/root /mnt - -# Format +# Format the EFI partition mkfs.fat -F 32 -n BOOT ${DISK}2 # Mount the partitions +mount ${DISK}1 /mnt mkdir -p /mnt/boot -mount -o umask=077 /dev/sda2 /mnt/boot - +mount ${DISK}2 /mnt/boot # Clone the configuration repository mkdir -p /mnt/etc/nixos