disk-config.nix (1185B)
1 # Example to create a bios compatible gpt partition 2 { lib, ... }: 3 { 4 disko.devices = { 5 disk.disk1 = { 6 device = lib.mkDefault "/dev/sda"; 7 type = "disk"; 8 content = { 9 type = "gpt"; 10 partitions = { 11 boot = { 12 name = "boot"; 13 size = "1M"; 14 type = "EF02"; 15 }; 16 esp = { 17 name = "ESP"; 18 size = "500M"; 19 type = "EF00"; 20 content = { 21 type = "filesystem"; 22 format = "vfat"; 23 mountpoint = "/boot"; 24 }; 25 }; 26 root = { 27 name = "root"; 28 size = "100%"; 29 content = { 30 type = "lvm_pv"; 31 vg = "pool"; 32 }; 33 }; 34 }; 35 }; 36 }; 37 lvm_vg = { 38 pool = { 39 type = "lvm_vg"; 40 lvs = { 41 root = { 42 size = "100%FREE"; 43 content = { 44 type = "filesystem"; 45 format = "ext4"; 46 mountpoint = "/"; 47 mountOptions = [ 48 "defaults" 49 ]; 50 }; 51 }; 52 }; 53 }; 54 }; 55 }; 56 }