{ ... }: # Disk layout for nixos-anywhere + disko. # Targets a single virtio disk (typical for Hetzner Cloud). # GPT with a BIOS-boot partition so GRUB works without UEFI. { disko.devices = { disk.main = { # Hetzner Cloud primary disk is /dev/sda on most instance types. # On NVMe instances it will be /dev/nvme0n1 - update accordingly. device = "/dev/sda"; type = "disk"; content = { type = "gpt"; partitions = { # 1 MiB BIOS-boot partition required by GRUB on GPT disks boot = { size = "1M"; type = "EF02"; # BIOS boot priority = 1; }; # 512 MiB /boot - keeps kernels/initrds out of root for clarity. # Named ESP for historical reasons (matches the GPT partition label # already baked into the live disk from initial install) even # though it's not really an EFI System Partition (ext4, not # FAT32/type EF00) - this is a BIOS-boot setup, GRUB just needs a # plain filesystem here. Do NOT rename this attribute: disko # derives the actual GPT partition label from it, and renaming it # here does not relabel the already-installed physical partition - # fileSystems."/boot" would then point at a by-partlabel device # that doesn't exist, hanging boot.mount/local-fs.target on # activation (this exact mistake took the server down once). ESP = { size = "512M"; type = "8300"; content = { type = "filesystem"; format = "ext4"; mountpoint = "/boot"; }; }; # Root partition - all remaining space root = { size = "100%"; content = { type = "filesystem"; format = "ext4"; mountpoint = "/"; }; }; }; }; }; }; }