summaryrefslogtreecommitdiffstats
path: root/example/gpt-bios-compat.nix
diff options
context:
space:
mode:
Diffstat (limited to 'example/gpt-bios-compat.nix')
-rw-r--r--example/gpt-bios-compat.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/example/gpt-bios-compat.nix b/example/gpt-bios-compat.nix
new file mode 100644
index 0000000..7275e26
--- /dev/null
+++ b/example/gpt-bios-compat.nix
@@ -0,0 +1,37 @@
+# Example to create a bios compatible gpt partition
+{ disks ? [ "/dev/vdb" ], ... }: {
+ disk = {
+ vdb = {
+ device = builtins.elemAt disks 0;
+ type = "disk";
+ content = {
+ type = "table";
+ format = "gpt";
+ partitions = [
+ {
+ name = "boot";
+ type = "partition";
+ start = "0";
+ end = "1M";
+ part-type = "primary";
+ flags = ["bios_grub"];
+ }
+ {
+ 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 = "/";
+ };
+ }
+ ];
+ };
+ };
+ };
+}