cherry-picked from https://github.com/nvmd/disko/commit/9dc58d4d49c9f74623a06e2fc20cdfd8bb3cbe8b usage example: - set attribute: https://github.com/nvmd/nixos-raspberrypi-demo/blob/2847963e7555fc412c1d0f37bb48c761e78f350d/disko-nvme-zfs.nix#L9L11 - check: https://github.com/nvmd/nixos-raspberrypi-demo/blob/2847963e7555fc412c1d0f37bb48c761e78f350d/flake.nix#L154L160
30 lines
645 B
Nix
30 lines
645 B
Nix
# Example to create a bios compatible gpt partition
|
|
{
|
|
disko.devices = {
|
|
disk = {
|
|
main = {
|
|
device = "/dev/vdb";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
boot = {
|
|
size = "1M";
|
|
type = "EF02"; # for grub MBR
|
|
attributes = [ 0 ]; # partition attribute
|
|
};
|
|
root = {
|
|
size = "100%";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "ext4";
|
|
mountpoint = "/";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|