···11# installation script for Hetzner VPS, I just loaded a standart nix iso in there
22# Stolen from @Jet https://github.com/Michael-C-Buckley/nixos/blob/master/modules/hosts/o1/tools/format.sh
33-# Adapted to use msdos partition table
4354#!/usr/bin/env bash
65set -euo pipefail
···2928echo "Wiping drives..."
3029# Wipe the NVMe
3130wipefs -a /dev/sda
3232-3333-parted /dev/sda --script mklabel msdos
3131+sgdisk --zap-all /dev/sda
34323533echo "Formatting drives..."
3634# Put boot on the NVMe then fill the rest with ZFS
3737-parted /dev/sda --script mkpart primary 1MiB 4097MiB
3838-parted /dev/sda --script mkpart primary 4097MiB 100%
3939-parted /dev/sda --script set 2 boot on
3535+sgdisk -n1:1M:+512M -t1:EF00 -c1:"EFI System" /dev/sda
3636+sgdisk -n2:0:+4G -t2:8200 -c2:"Linux Swap" /dev/sda
3737+sgdisk -n3:0:0 -t3:BF01 -c3:"ZROOT" /dev/sda
3838+3939+# Format the boot partition
4040+mkfs.vfat -F32 /dev/sda1
40414142# Swap
4242-mkswap /dev/sda1
4343-swapon /dev/sda1
4343+mkswap /dev/sda2
4444+swapon /dev/sda2
44454546# Create the pool on the drive, use reasonable settings
4647echo "Creating zroot..."
···4950# Mount the drives and prepare for the install
5051mkdir -p /mnt
5152mkdir -p /mnt/{cache,nix,persist,tmp,boot}
5353+mount /dev/sda1 /mnt/boot
52545355# This create the zvols used in this cluster
5456for zvol in "tmp" "nix" "cache" "persist"; do