2022-09-04 10:10:09 +00:00
|
|
|
# Example to create a bios compatible gpt partition
|
2022-10-21 12:43:55 +00:00
|
|
|
{ disks ? [ "/dev/vdb" ], ... }: {
|
2022-09-04 10:10:09 +00:00
|
|
|
disk = {
|
|
|
|
vdb = {
|
2022-09-30 10:55:28 +00:00
|
|
|
device = builtins.elemAt disks 0;
|
2022-09-04 10:10:09 +00:00
|
|
|
type = "disk";
|
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
|
|
|
{
|
|
|
|
name = "boot";
|
|
|
|
type = "partition";
|
|
|
|
start = "0";
|
|
|
|
end = "1M";
|
|
|
|
part-type = "primary";
|
2023-02-07 15:56:08 +00:00
|
|
|
flags = [ "bios_grub" ];
|
2022-09-04 10:10:09 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "root";
|
|
|
|
type = "partition";
|
|
|
|
# leave space for the grub aka BIOS boot
|
|
|
|
start = "1M";
|
|
|
|
end = "100%";
|
|
|
|
part-type = "primary";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|