2022-10-21 15:43:55 +03:00
|
|
|
{ disks ? [ "/dev/vdb" "/dev/vdc" ], ... }: {
|
2022-08-29 12:45:19 +03:00
|
|
|
disk = {
|
2022-09-30 13:55:28 +03:00
|
|
|
one = {
|
2022-08-29 12:45:19 +03:00
|
|
|
type = "disk";
|
2022-09-30 13:55:28 +03:00
|
|
|
device = builtins.elemAt disks 0;
|
2022-08-29 12:45:19 +03:00
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
2022-09-30 13:55:28 +03:00
|
|
|
{
|
|
|
|
name = "boot";
|
|
|
|
type = "partition";
|
|
|
|
start = "0";
|
|
|
|
end = "100M";
|
|
|
|
fs-type = "fat32";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "boot";
|
|
|
|
};
|
|
|
|
}
|
2022-08-29 12:45:19 +03:00
|
|
|
{
|
|
|
|
type = "partition";
|
|
|
|
name = "primary";
|
2022-09-30 13:55:28 +03:00
|
|
|
start = "100M";
|
2022-08-29 12:45:19 +03:00
|
|
|
end = "100%";
|
|
|
|
content = {
|
|
|
|
type = "lvm_pv";
|
|
|
|
vg = "pool";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-08-25 19:36:56 +03:00
|
|
|
};
|
2022-09-30 13:55:28 +03:00
|
|
|
two = {
|
2022-08-29 12:45:19 +03:00
|
|
|
type = "disk";
|
2022-09-30 13:55:28 +03:00
|
|
|
device = builtins.elemAt disks 1;
|
2022-08-29 12:45:19 +03:00
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
2022-09-30 13:55:28 +03:00
|
|
|
{
|
|
|
|
name = "boot";
|
|
|
|
type = "partition";
|
|
|
|
start = "0";
|
|
|
|
end = "100M";
|
|
|
|
fs-type = "fat32";
|
|
|
|
bootable = true;
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "boot";
|
|
|
|
};
|
|
|
|
}
|
2022-08-29 12:45:19 +03:00
|
|
|
{
|
|
|
|
type = "partition";
|
|
|
|
name = "primary";
|
2022-09-30 13:55:28 +03:00
|
|
|
start = "100M";
|
2022-08-29 12:45:19 +03:00
|
|
|
end = "100%";
|
|
|
|
content = {
|
|
|
|
type = "lvm_pv";
|
|
|
|
vg = "pool";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-08-25 19:36:56 +03:00
|
|
|
};
|
2022-08-29 12:45:19 +03:00
|
|
|
};
|
2022-09-30 13:55:28 +03:00
|
|
|
mdadm = {
|
|
|
|
boot = {
|
|
|
|
type = "mdadm";
|
|
|
|
level = 1;
|
|
|
|
metadata = "1.0";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-08-29 12:45:19 +03:00
|
|
|
lvm_vg = {
|
2022-08-25 19:36:56 +03:00
|
|
|
pool = {
|
|
|
|
type = "lvm_vg";
|
2022-08-29 12:45:19 +03:00
|
|
|
lvs = {
|
|
|
|
root = {
|
|
|
|
type = "lvm_lv";
|
|
|
|
size = "100M";
|
|
|
|
lvm_type = "mirror";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
2022-08-25 19:36:56 +03:00
|
|
|
mountpoint = "/";
|
2022-08-29 12:45:19 +03:00
|
|
|
options = [
|
|
|
|
"defaults"
|
|
|
|
];
|
2022-08-25 19:36:56 +03:00
|
|
|
};
|
2022-08-29 12:45:19 +03:00
|
|
|
};
|
|
|
|
home = {
|
|
|
|
type = "lvm_lv";
|
|
|
|
size = "10M";
|
|
|
|
lvm_type = "raid0";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/home";
|
2022-08-25 19:36:56 +03:00
|
|
|
};
|
|
|
|
};
|
2022-08-29 12:45:19 +03:00
|
|
|
};
|
2022-08-25 19:36:56 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|