2024-11-19 10:31:29 +01:00
|
|
|
{
|
|
|
|
disks ? [
|
|
|
|
"/dev/sda"
|
|
|
|
"/dev/sdb"
|
|
|
|
],
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2024-03-21 15:00:36 +01:00
|
|
|
disk = {
|
|
|
|
one = {
|
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 0;
|
|
|
|
content = {
|
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
boot = {
|
|
|
|
size = "1M";
|
|
|
|
type = "EF02";
|
|
|
|
};
|
|
|
|
ESP = {
|
|
|
|
size = "256M";
|
|
|
|
type = "EF00";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mdadm = {
|
|
|
|
size = "100%";
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "raid1";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
two = {
|
|
|
|
type = "disk";
|
|
|
|
device = builtins.elemAt disks 1;
|
|
|
|
content = {
|
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
boot = {
|
|
|
|
size = "1M";
|
|
|
|
type = "EF02";
|
|
|
|
};
|
|
|
|
ESP = {
|
|
|
|
size = "256M";
|
|
|
|
type = "EF00";
|
|
|
|
};
|
|
|
|
mdadm = {
|
|
|
|
size = "100%";
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "raid1";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mdadm = {
|
|
|
|
raid1 = {
|
|
|
|
type = "mdadm";
|
|
|
|
level = 1;
|
|
|
|
content = {
|
|
|
|
type = "luks";
|
|
|
|
name = "crypted";
|
|
|
|
extraOpenArgs = [ "--allow-discards" ];
|
|
|
|
settings = {
|
|
|
|
allowDiscards = true;
|
|
|
|
};
|
|
|
|
initrdUnlock = false;
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "btrfs";
|
|
|
|
mountpoint = "/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|