{ device ? throw "Set this to your disk device, e.g. /dev/sda" , swap-size ? "0" , encrypted ? false , ... }: { 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 = if swap-size == "0" then {} else { size = swap-size; content = { type = "swap"; resumeDevice = true; }; }; # Fill until 8gb are left root = if encrypted then { 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 = (import ./disko-btrfs-impermanence.nix); }; } else { size = "100%"; content = (import ./disko-btrfs-impermanence.nix); }; }; }; }; }; }; }