383 lines
12 KiB
Nix
Executable File
383 lines
12 KiB
Nix
Executable File
{
|
|
disko.devices = {
|
|
disk = {
|
|
#################################################################
|
|
# HDD1
|
|
#################################################################
|
|
hdd1 = {
|
|
device = "/dev/disk/by-id/ata-ST24000DM001-3Y7103_ZXA0QYPG";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
hdd1p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "hdd1-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "hdd.hdd1";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# HDD2
|
|
#################################################################
|
|
hdd2 = {
|
|
device = "/dev/disk/by-id/ata-ST24000NM000C-3WD103_ZXA0H7EQ";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
hdd2p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "hdd2-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "hdd.hdd2";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# SSD1
|
|
#################################################################
|
|
ssd1 = {
|
|
device = "/dev/disk/by-id/nvme-CT1000P310SSD8_25034D8045A9";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd1p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "ssd1-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "ssd.ssd1";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# SSD2
|
|
#################################################################
|
|
ssd2 = {
|
|
device = "/dev/disk/by-id/nvme-CT1000P310SSD8_25185002525B";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd2p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "ssd2-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "ssd.ssd2";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# SSD3
|
|
#################################################################
|
|
ssd3 = {
|
|
device = "/dev/disk/by-id/nvme-CT1000P310SSD8_25285184CC5C";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd3p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "ssd3-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "ssd.ssd3";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# SSD4
|
|
#################################################################
|
|
ssd4 = {
|
|
device = "/dev/disk/by-id/nvme-CT1000P310SSD8_25285186280D";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd4p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "ssd4-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "ssd.ssd4";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# SSD5
|
|
#################################################################
|
|
ssd5 = {
|
|
device = "/dev/disk/by-id/nvme-INTEL_SSDPEKNW010T8_PHNH845600381P0B";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd5p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "ssd5-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "ssd.ssd5";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
#################################################################
|
|
# SSD6
|
|
#################################################################
|
|
ssd6 = {
|
|
device = "/dev/disk/by-id/nvme-WDS100T3X0C-00SJG0_202007A00A86";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd6p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "ssd6-cryptroot";
|
|
extraOpenArgs = [
|
|
"--allow-discards"
|
|
"--perf-no_read_workqueue"
|
|
"--perf-no_write_workqueue"
|
|
];
|
|
settings = {
|
|
allowDiscards = true;
|
|
# keyFile = lib.snowfall.fs.get-file "secrets/nas_pool.key";
|
|
crypttabExtraOpts = [
|
|
"tpm2-device=auto"
|
|
"fido2-device=auto"
|
|
"token-timeout=10"
|
|
];
|
|
};
|
|
content = {
|
|
type = "bcachefs";
|
|
filesystem = "nas_pool_subvolumes";
|
|
label = "ssd.ssd6";
|
|
extraFormatArgs = [
|
|
"--discard"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
bcachefs_filesystems = {
|
|
nas_pool_subvolumes = {
|
|
type = "bcachefs_filesystem";
|
|
extraFormatArgs = [
|
|
"--compression=zstd"
|
|
"--background_compression=zstd"
|
|
"--metadata_tartget=ssd"
|
|
"--promote_tartget=ssd"
|
|
"--foreground_target=ssd"
|
|
"--background_target=hdd"
|
|
"--data_replicas=2"
|
|
];
|
|
subvolumes = {
|
|
"backup" = {
|
|
mountpoint = "/media/nas/main/backup";
|
|
};
|
|
"documents" = {
|
|
mountpoint = "/media/nas/main/documents";
|
|
};
|
|
"heroic" = {
|
|
mountpoint = "/media/nas/games/heroic";
|
|
};
|
|
"movies" = {
|
|
mountpoint = "/media/nas/main/movies";
|
|
};
|
|
"photos" = {
|
|
mountpoint = "/media/nas/main/photos";
|
|
};
|
|
"steam" = {
|
|
mountpoint = "/media/nas/games/steam";
|
|
};
|
|
"tv" = {
|
|
mountpoint = "/media/nas/main/tv";
|
|
};
|
|
"persist" = {
|
|
mountpoint = "/persist";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|