2023-08-10 10:47:01 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
{
|
|
|
|
disko.devices.disk = lib.genAttrs [ "a" "b" ] (name: {
|
|
|
|
type = "disk";
|
|
|
|
device = "/dev/sd${name}";
|
|
|
|
content = {
|
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
boot = {
|
|
|
|
size = "1M";
|
|
|
|
type = "EF02"; # for grub MBR
|
|
|
|
};
|
|
|
|
ESP = {
|
2023-09-27 06:13:25 +00:00
|
|
|
size = "500M";
|
2023-08-10 10:47:01 +00:00
|
|
|
type = "EF00";
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "boot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
mdadm = {
|
|
|
|
size = "100%";
|
|
|
|
content = {
|
|
|
|
type = "mdraid";
|
|
|
|
name = "raid1";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
disko.devices.mdadm = {
|
|
|
|
boot = {
|
|
|
|
type = "mdadm";
|
|
|
|
level = 1;
|
|
|
|
metadata = "1.0";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
raid1 = {
|
|
|
|
type = "mdadm";
|
|
|
|
level = 1;
|
|
|
|
content = {
|
|
|
|
type = "luks";
|
|
|
|
name = "crypted";
|
|
|
|
settings.keyFile = "/tmp/secret.key";
|
2023-08-11 06:11:01 +00:00
|
|
|
content = {
|
2023-08-10 10:47:01 +00:00
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|