Reviewed-on: #1 Co-authored-by: Tristan <tristan@vault81.mozmail.com> Co-committed-by: Tristan <tristan@vault81.mozmail.com>
184 lines
5.6 KiB
Nix
184 lines
5.6 KiB
Nix
{
|
|
disko.devices = {
|
|
disk = {
|
|
cryptboot_1 = {
|
|
type = "disk";
|
|
device = "/dev/disk/by-path/pci-0000:08:00.0-nvme-1";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
luks = {
|
|
# size = "831.5G";
|
|
end = "-100G";
|
|
label = "Linux LUKS";
|
|
type = "8309";
|
|
content = {
|
|
type = "luks";
|
|
name = "cryptboot_1";
|
|
extraOpenArgs = [ "--allow-discards" ];
|
|
passwordFile = "/tmp/secret.key";
|
|
additionalKeyFiles = [ ];
|
|
# content is empty here as the btrfs partition will be created via extraArgs of the cryptroot_1 partition def
|
|
};
|
|
};
|
|
luksSwap = {
|
|
# TODO Create
|
|
size = "32G";
|
|
content = {
|
|
type = "luks";
|
|
name = "cryptswap_0";
|
|
extraOpenArgs = [ "--allow-discards" ];
|
|
passwordFile = "/tmp/secret.key";
|
|
additionalKeyFiles = [ ];
|
|
content = {
|
|
type = "swap";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
cryptboot_0 = {
|
|
type = "disk";
|
|
device = "/dev/disk/by-path/pci-0000:03:00.0-nvme-1";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
luks = {
|
|
# size = "831.5G";
|
|
end = "-100G";
|
|
label = "Linux LUKS";
|
|
type = "8309";
|
|
content = {
|
|
type = "luks";
|
|
name = "cryptboot_0";
|
|
extraOpenArgs = [ "--allow-discards" ];
|
|
passwordFile = "/tmp/secret.key";
|
|
additionalKeyFiles = [ ];
|
|
content = {
|
|
# this partiton needs to be in the last parent part alphabetically to ensure the referenced dev already exists
|
|
type = "btrfs";
|
|
extraArgs = [
|
|
"-L cryptboot_btrfs"
|
|
"-f"
|
|
"-m raid1"
|
|
"-d raid1"
|
|
"/dev/mapper/cryptboot_0"
|
|
];
|
|
subvolumes = {
|
|
"/" = {
|
|
mountpoint = "/media/@btrfsroot";
|
|
mountOptions = [
|
|
"rw"
|
|
"autodefrag"
|
|
"compress=zstd"
|
|
"discard=async"
|
|
"relatime"
|
|
"space_cache=v2"
|
|
"ssd"
|
|
];
|
|
};
|
|
"/_active" = { };
|
|
"/_active/rootvol" = { };
|
|
"/_active/pkgvol" = { };
|
|
"/_active/nix_rootvol" = {
|
|
mountpoint = "/";
|
|
mountOptions = [
|
|
"rw"
|
|
"autodefrag"
|
|
"compress=zstd"
|
|
"discard=async"
|
|
"relatime"
|
|
"space_cache=v2"
|
|
"ssd"
|
|
];
|
|
};
|
|
"/_active/homevol" = {
|
|
mountpoint = "/home";
|
|
mountOptions = [
|
|
"rw"
|
|
"autodefrag"
|
|
"compress=zstd"
|
|
"discard=async"
|
|
"relatime"
|
|
"space_cache=v2"
|
|
"ssd"
|
|
];
|
|
};
|
|
"/_active/nixvol" = {
|
|
mountpoint = "/nix";
|
|
mountOptions = [
|
|
"rw"
|
|
"autodefrag"
|
|
"compress=zstd"
|
|
"discard=async"
|
|
"relatime"
|
|
"space_cache=v2"
|
|
"ssd"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
ESP = {
|
|
label = "EFI system partition";
|
|
name = "ESP";
|
|
size = "1024M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [
|
|
"rw"
|
|
"relatime"
|
|
"fmask=0022"
|
|
"dmask=0022"
|
|
"codepage=437"
|
|
"iocharset=ascii"
|
|
"shortname=mixed"
|
|
"utf8"
|
|
"errors=remount-ro"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
sandisk = {
|
|
type = "disk";
|
|
device = "/dev/disk/by-path/pci-0000:06:00.0-ata-4";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
luks = {
|
|
# ~size = "3.4T";
|
|
end = "-250G";
|
|
label = "Linux filesystem";
|
|
type = "8300";
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [ ];
|
|
subvolumes = {
|
|
"/" = {
|
|
mountpoint = "/media/SanDisk";
|
|
mountOptions = [
|
|
"rw"
|
|
"autodefrag"
|
|
"compress=zstd"
|
|
"discard=async"
|
|
"relatime"
|
|
"space_cache=v2"
|
|
"ssd"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|