disko/example/mdadm.nix

84 lines
1.7 KiB
Nix
Raw Normal View History

2022-10-21 14:43:55 +02:00
{ disks ? [ "/dev/vdb" "/dev/vdc" ], ... }: {
disk = {
2022-08-24 16:46:36 +02:00
vdb = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "boot";
type = "partition";
start = "0";
end = "1M";
part-type = "primary";
flags = [ "bios_grub" ];
}
{
type = "partition";
name = "mdadm";
start = "1MiB";
end = "100%";
content = {
type = "mdraid";
name = "raid1";
};
}
];
};
2022-08-24 16:46:36 +02:00
};
vdc = {
type = "disk";
device = builtins.elemAt disks 1;
content = {
type = "table";
format = "gpt";
partitions = [
{
name = "boot";
type = "partition";
start = "0";
end = "1M";
part-type = "primary";
flags = [ "bios_grub" ];
}
{
type = "partition";
name = "mdadm";
start = "1MiB";
end = "100%";
content = {
type = "mdraid";
name = "raid1";
};
}
];
};
2022-08-24 16:46:36 +02:00
};
};
mdadm = {
2022-08-24 16:46:36 +02:00
raid1 = {
type = "mdadm";
level = 1;
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "primary";
2022-08-24 16:46:36 +02:00
start = "1MiB";
end = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
2022-08-24 16:46:36 +02:00
};
}
];
};
};
};
}