Files
homelab/hosts/terra/disk-config.nix
T
2026-07-24 20:38:36 +02:00

51 lines
1.8 KiB
Nix

{ ... }:
# Declarative OS-disk layout (disko). UEFI: GPT with an ESP + btrfs root.
# disko both PARTITIONS/FORMATS this disk and generates the NixOS
# `fileSystems.*` entries, so hardware-configuration.nix must NOT define
# fileSystems for "/" or "/boot".
#
# ⚠️ Root is btrfs (was ext4): the disk previously held a CachyOS btrfs root,
# and disko's `mkfs` create step SKIPS formatting when `blkid` still
# detects a filesystem signature on the freshly-cut partition. A stale
# btrfs superblock survives `wipefs`+repartition inside the new root
# partition's range, so an ext4 root got skipped and `mount -t ext4`
# then failed on the leftover btrfs bytes ("bad superblock"). btrfs's
# create runs `mkfs.btrfs -f`, which reformats past any stale signature.
#
# ⚠️ This disk is WIPED on install. This is the Kingston SA400 SSD that
# currently holds CachyOS (btrfs root+subvols on sdb2, ESP on sdb1).
# The dev-data disks (sdc ext4 /mnt/hdd_01, LVM vg_ssd /mnt/ssd_01) and the
# leftover ntfs disks (sda, sdf, nvme0n1) are NOT listed here — they are
# mounted as plain fileSystems in configuration.nix (or, for the ntfs
# disks, ignored entirely) so they are never touched.
{
disko.devices.disk.os = {
type = "disk";
device = "/dev/disk/by-id/ata-KINGSTON_SA400S37480G_50026B738072F6C6";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
mountpoint = "/";
};
};
};
};
};
}