Files
Nix-Vibe/hosts/homeserver-1/disko-config.nix
T

76 lines
1.7 KiB
Nix

{
disk = {
main = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for GRUB MBR fallback
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
data1 = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
data = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
mountOptions = [
"defaults"
"nofail"
];
mountpoint = "/data";
};
};
};
};
};
data2 = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
data = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
postCreateHook = ''
btrfs device add -f /dev/disk/by-partlabel/disk-data2-data /mnt/data || true
btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/data || true
'';
};
};
};
};
};
};
}