let espPartition = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = [ "umask=0077" ]; }; rootPartition = { type = "btrfs"; extraArgs = [ "-f" ]; # override existing partition subvolumes = { "/root" = { mountpoint = "/"; mountOptions = [ "subvol=root" "compress=zstd" "noatime" ]; }; "/home" = { mountOptions = [ "subvol=home" "compress=zstd" "noatime" ]; mountpoint = "/home"; }; "/nix" = { mountOptions = [ "subvol=nix" "compress=zstd" "noatime" ]; mountpoint = "/nix"; }; "/log" = { mountpoint = "/var/log"; mountOptions = [ "subvol=log" "compress=zstd" "noatime" ]; }; "/lib" = { mountpoint = "/var/lib"; mountOptions = [ "subvol=lib" "compress=zstd" "noatime" ]; }; "/persist" = { mountpoint = "/var/lib/persist"; mountOptions = [ "subvol=persist" "compress=zstd" "noatime" ]; }; "/secrets" = { mountpoint = "/var/lib/secrets"; mountOptions = [ "subvol=secrets" "compress=zstd" "noatime" ]; }; }; }; in { disko.devices.disk.vm-disk = { type = "disk"; device = "/dev/vda"; imageSize = "10G"; content = { type = "gpt"; partitions = { ESP = { priority = 1; name = "ESP"; label = "boot"; size = "1G"; type = "EF00"; content = espPartition; }; root = { size = "100%"; name = "root"; label = "root"; content = rootPartition; }; }; }; }; fileSystems."/var/lib/persist".neededForBoot = true; fileSystems."/var/log".neededForBoot = true; fileSystems."/var/lib".neededForBoot = true; }