{ disko.devices = { nodev = { "/" = { fsType = "tmpfs"; mountOptions = [ "defaults" "size=8G" "mode=755" "nosuid" "nodev" ]; }; }; disk = { main = { type = "disk"; device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1"; content = { type = "gpt"; partitions = { esp = { label = "ESP"; size = "2G"; type = "EF00"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = [ "umask=0077" ]; }; }; cryptroot = { label = "CRYPTROOT"; size = "100%"; content = { type = "luks"; name = "cryptroot"; settings = { allowDiscards = true; bypassWorkqueues = true; crypttabExtraOpts = [ "same-cpu-crypt" "submit-from-crypt-cpus" ]; # unattended boot via usb keyFile = "/dev/disk/by-id/usb-aigo_U330_80101016-0:0"; keyFileSize = 512 * 64; }; content = { type = "btrfs"; extraArgs = [ "-f" ]; subvolumes = { "/persist" = { mountpoint = "/persist"; mountOptions = [ "compress=zstd" ]; }; "/nix" = { mountpoint = "/nix"; mountOptions = [ "compress=zstd" ]; }; }; }; }; }; }; }; }; }; }; fileSystems."/persist".neededForBoot = true; environment.globalPersistence = { enable = true; root = "/persist"; }; services.btrfs.autoScrub = { enable = true; interval = "weekly"; fileSystems = [ "/persist" ]; }; }