Create luks-btrfs-raid.nix

This commit is contained in:
Sk7Str1pe authored and Felix Uhl committed 2024-10-01 19:34:46 +02:00
1 parent 037be88911
commit c312692abe
1 file changed
+52
+52
View File
@@ -0,0 +1,52 @@
{
disko.devices = {
disk = {
disk0 = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
crypted2 = {
name = "crypt_raidp2";
size = "100%";
content = {
type = "luks";
name = "raidp2"; # this is DM name
};
};
};
};
};
disk1 = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
crypted1 = {
size = "100%";
name = "crypt_raidp1";
content = {
type = "luks";
name = "raidp1";
content = {
type = "btrfs";
extraArgs = [ "-f" "-m raid1 -d raid1" "/dev/mapper/raidp2"]; # raidp2 - DM name of 2nd disk
subvolumes = {
"/" = {
mountpoint = "/mnt/SoftWare";
mountOptions = [
"rw" "relatime" "ssd" "discard=async" "space_cache=v2" "subvolid=5" "subvol=/"
];
};
};
};
};
};
};
};
};
};
};
}