{ device ? throw "Set this to your disk device, e.g. /dev/sda" , ... }: { disko.devices = { disk = { main = { inherit device; type = "disk"; content = { type = "gpt"; partitions = { ESP = { size = "512M"; type = "EF00"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; mountOptions = [ "defaults" ]; }; }; swap = { size = "8G"; content = { type = "swap"; resumeDevice = true; }; }; # Fill until 8gb are left luks = { size = "100%"; content = { type = "luks"; name = "crypted"; # disable settings.keyFile if you want to use interactive password entry passwordFile = null; # Interactive settings = { allowDiscards = true; keyFile = null; }; # additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; content = { type = "btrfs"; extraArgs = [ "-f" ]; subvolumes = { "/root" = { mountpoint = "/"; mountOptions = [ "compress=zstd" "noatime" ]; }; "/persist" = { mountpoint = "/persist"; mountOptions = [ "subvol=persist" "compress=zstd" "noatime" ]; }; "/nix" = { mountpoint = "/nix"; mountOptions = [ "subvol=nix" "compress=zstd" "noatime" ]; }; }; }; }; }; }; }; }; }; }; }