nixcfg/systems/x86_64-linux/mx/server-raid.nix
Harald Hoyer 900f95169f nix fmt
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2024-11-19 10:31:29 +01:00

85 lines
1.6 KiB
Nix

{
disks ? [
"/dev/sda"
"/dev/sdb"
],
...
}:
{
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 = "/";
};
};
};
};
}