Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Storage

Filesystems at a glance

FSUse in this flakeBest for
ext411 hosts — root + dataSimplicity, zero maintenance
btrfs3 hosts — root (shinji, yhwach, kyuubi)Compression, snapshots
zfs2 hosts — data pools only (sado, kuchiki)Large storage, checksums
vfatEvery host with /boot (EFI)EFI system partition

Host → filesystem mapping

HostRootDataManaged by
shinjibtrfs (@root + @nix)disko
yhwachbtrfs (subvol=@)hardware-config
kyuubibtrfs (subvol=@)hardware-config
sadoext4zfs (/mnt/flash)hardware-config
kuchikiext4zfs (/mnt/storage)hardware-config
kenpachiext4 (LVM)disko
aizenext4 (LVM)disko
7 othersext4hardware-config

Choosing a filesystem for a new host

  • ext4 — the default. Simple, proven, zero configuration. Used on 11 of 14 hosts.
  • btrfs — when you want transparent zstd compression (saves ~25% on /nix/store) or snapshot support. Use the @root + @nix subvolume layout to keep snapshots lightweight. See btrfs.md for details.
  • zfs — only for dedicated data pools that benefit from checksums, dedup, or RAID-Z. Do not use for root: the out-of-tree kernel module frequently breaks on kernel updates.

Disko

Disko provides declarative disk partitioning. Instead of manually running fdisk, mkfs, and recording UUIDs in hardware-configuration.nix, you define everything in a disk.nix:

  • Partition layout (BIOS boot, ESP, root)
  • Filesystem type (ext4, btrfs, zfs)
  • Subvolume layout for btrfs
  • LVM volumes if needed

Disko is imported per-host via inputs.disko.nixosModules.disko in the host’s disk.nix. Currently 3 of 14 hosts use it (shinji, kenpachi, aizen). The rest use a manually-generated hardware-configuration.nix with explicit fileSystems entries.

When disko manages the filesystems, the fileSystems entries in hardware-configuration.nix should be commented out — disko generates them declaratively at build time.

Example: shinji

# systems/x86_64-linux/shinji/default.nix
{ inputs, ... }: {
  imports = [
    ./configuration.nix
    ./disk.nix              # disko: btrfs on NVMe with @root + @nix subvolumes
    ./hardware-configuration.nix  # fileSystems commented out, disko handles them
  ];
}

See btrfs.md for a complete disko + btrfs walkthrough.