This commit is contained in:
albert 2024-07-14 20:45:29 +09:00
parent 17a3d8dfec
commit e1b6c937b3
Signed by: albert
GPG key ID: 3895DD267CA11BA9

View file

@ -1,16 +1,14 @@
{ lib, ... }:
{ {
# https://github.com/nix-community/disko/blob/master/example/boot-raid1.nix disko.devices.disk = lib.genAttrs [ "a" "b" ] (name: {
disko.devices = {
disk = {
sda = {
type = "disk"; type = "disk";
device = "/dev/sda"; device = "/dev/sd${name}";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
boot = { boot = {
size = "1M"; size = "1M";
type = "EF02"; # GRUB MBR type = "EF02"; # for grub MBR
}; };
ESP = { ESP = {
size = "500M"; size = "500M";
@ -29,39 +27,8 @@
}; };
}; };
}; };
}; });
disko.devices.mdadm = {
sdb = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # GRUB MBR
};
ESP = {
size = "500M";
type = "EF00";
content = {
type = "mdraid";
name = "boot";
};
};
mdadm = {
size = "100%";
content = {
type = "mdraid";
name = "raid1";
};
};
};
};
};
};
mdadm = {
boot = { boot = {
type = "mdadm"; type = "mdadm";
level = 1; level = 1;
@ -77,8 +44,7 @@
level = 1; level = 1;
content = { content = {
type = "luks"; type = "luks";
name = "ROOT"; name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
content = { content = {
type = "filesystem"; type = "filesystem";
format = "ext4"; format = "ext4";
@ -87,5 +53,4 @@
}; };
}; };
}; };
};
} }