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
ext4the default root filesystem for most hostsSimplicity, zero maintenance
btrfsroot on shinji, yhwach, kyuubiCompression, snapshots
zfsdata 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
all othersext4hardware-config

Choosing a filesystem for a new host

  • ext4 — the default. Simple, proven, zero configuration. Used on most 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. A few 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.