Huge update to the disk selection method. Now support striped or mirrored boot disk(s), and up to 9 disks for data with automatic inclusion of up to 3 parity disks.

This commit is contained in:
Raphael Numbus
2025-11-23 19:36:37 +01:00
parent 6827785db7
commit 8601bdad7f
9 changed files with 320 additions and 587 deletions
+73
View File
@@ -0,0 +1,73 @@
{ lib, ... }:
{
disko.devices = {
disk = {
system-1 = {
type = "disk";
device = "${BOOT_DISK_1}";
content = {
type = "gpt";
partitions = {
ESP = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
crypt_p1 = {
size = "100%";
content = {
type = "luks";
name = "nixos-p1";
settings = {
allowDiscards = true;
};
};
};
};
};
};
system-2 = {
type = "disk";
device = "${BOOT_DISK_2}";
content = {
type = "gpt";
partitions = {
crypt_p2 = {
size = "100%";
content = {
type = "luks";
name = "nixos-p2";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [
"-d raid1"
"/dev/mapper/nixos-p1"
];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"rw"
"relatime"
"ssd"
];
};
"/swap" = {
mountpoint = "none";
swap.size = "16G";
};
};
};
};
};
};
};
};