153 lines
4.3 KiB
Nix
153 lines
4.3 KiB
Nix
{
|
|
disko.devices = {
|
|
disk = {
|
|
main = {
|
|
device = "/dev/disk/by-id/nvme-SAMSUNG_MZVL22T0HBLB-00BL2_S64RNE0R602762";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
boot = {
|
|
name = "boot";
|
|
size = "1M";
|
|
type = "EF02";
|
|
};
|
|
esp = {
|
|
name = "esp";
|
|
size = "512M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [ "umask=0077" ];
|
|
};
|
|
};
|
|
swap = {
|
|
name = "swap";
|
|
size = "64G";
|
|
content = {
|
|
type = "swap";
|
|
resumeDevice = true;
|
|
};
|
|
};
|
|
root = {
|
|
name = "root";
|
|
size = "100%";
|
|
content = {
|
|
name = "main";
|
|
type = "luks";
|
|
passwordFile = "/tmp/keyfile";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [ "-f" ];
|
|
subvolumes =
|
|
let
|
|
mountOptions = [
|
|
"compress=zstd:1"
|
|
"noatime"
|
|
"user_subvol_rm_allowed"
|
|
];
|
|
in
|
|
{
|
|
"@" = {
|
|
mountpoint = "/";
|
|
inherit mountOptions;
|
|
};
|
|
"@persist" = {
|
|
mountpoint = "/persist";
|
|
inherit mountOptions;
|
|
};
|
|
"@persist/user" = {
|
|
mountpoint = "/persist/user";
|
|
inherit mountOptions;
|
|
};
|
|
"@persist/state" = {
|
|
mountpoint = "/persist/state";
|
|
inherit mountOptions;
|
|
};
|
|
"@persist/cache" = {
|
|
mountpoint = "/persist/cache";
|
|
inherit mountOptions;
|
|
};
|
|
"@nix" = {
|
|
mountpoint = "/nix";
|
|
inherit mountOptions;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
storage0 = {
|
|
device = "/dev/disk/by-id/ata-TOSHIBA_MG08ACA16TE_51K0A2KEFWTG";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
root = {
|
|
name = "root";
|
|
size = "100%";
|
|
content = {
|
|
name = "storage0";
|
|
type = "luks";
|
|
passwordFile = "/tmp/keyfile";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
storage1 = {
|
|
device = "/dev/disk/by-id/ata-TOSHIBA_MG08ACA16TE_51K0A1WVFWTG";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
root = {
|
|
name = "root";
|
|
size = "100%";
|
|
content = {
|
|
name = "storage1";
|
|
type = "luks";
|
|
passwordFile = "/tmp/keyfile";
|
|
settings = {
|
|
allowDiscards = true;
|
|
};
|
|
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [ "-f -L storage -m raid1 -d raid1 /dev/mapper/storage0" ];
|
|
subvolumes =
|
|
let
|
|
mountOptions = [
|
|
"compress=zstd:5"
|
|
"noatime"
|
|
"user_subvol_rm_allowed"
|
|
];
|
|
in
|
|
{
|
|
"@" = {
|
|
mountpoint = "/mnt/storage";
|
|
inherit mountOptions;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|