···1# installation script for Hetzner VPS, I just loaded a standart nix iso in there
2# Stolen from @Jet https://github.com/Michael-C-Buckley/nixos/blob/master/modules/hosts/o1/tools/format.sh
3-# Adapted to use msdos partition table
45#!/usr/bin/env bash
6set -euo pipefail
···29echo "Wiping drives..."
30# Wipe the NVMe
31wipefs -a /dev/sda
32-33-parted /dev/sda --script mklabel msdos
3435echo "Formatting drives..."
36# Put boot on the NVMe then fill the rest with ZFS
37-parted /dev/sda --script mkpart primary 1MiB 4097MiB
38-parted /dev/sda --script mkpart primary 4097MiB 100%
39-parted /dev/sda --script set 2 boot on
0004041# Swap
42-mkswap /dev/sda1
43-swapon /dev/sda1
4445# Create the pool on the drive, use reasonable settings
46echo "Creating zroot..."
···49# Mount the drives and prepare for the install
50mkdir -p /mnt
51mkdir -p /mnt/{cache,nix,persist,tmp,boot}
05253# This create the zvols used in this cluster
54for zvol in "tmp" "nix" "cache" "persist"; do
···1# installation script for Hetzner VPS, I just loaded a standart nix iso in there
2# Stolen from @Jet https://github.com/Michael-C-Buckley/nixos/blob/master/modules/hosts/o1/tools/format.sh
034#!/usr/bin/env bash
5set -euo pipefail
···28echo "Wiping drives..."
29# Wipe the NVMe
30wipefs -a /dev/sda
31+sgdisk --zap-all /dev/sda
03233echo "Formatting drives..."
34# Put boot on the NVMe then fill the rest with ZFS
35+sgdisk -n1:1M:+512M -t1:EF00 -c1:"EFI System" /dev/sda
36+sgdisk -n2:0:+4G -t2:8200 -c2:"Linux Swap" /dev/sda
37+sgdisk -n3:0:0 -t3:BF01 -c3:"ZROOT" /dev/sda
38+39+# Format the boot partition
40+mkfs.vfat -F32 /dev/sda1
4142# Swap
43+mkswap /dev/sda2
44+swapon /dev/sda2
4546# Create the pool on the drive, use reasonable settings
47echo "Creating zroot..."
···50# Mount the drives and prepare for the install
51mkdir -p /mnt
52mkdir -p /mnt/{cache,nix,persist,tmp,boot}
53+mount /dev/sda1 /mnt/boot
5455# This create the zvols used in this cluster
56for zvol in "tmp" "nix" "cache" "persist"; do