76 lines
2.0 KiB
Nix
76 lines
2.0 KiB
Nix
{ lib, ... }:
|
|
{
|
|
disko.devices = {
|
|
disk = {
|
|
"boot-1" = {
|
|
type = "disk";
|
|
device = "${BOOT_DISK_1_ID}";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ESP = {
|
|
size = "1G";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
mountOptions = [ "umask=0077" ];
|
|
};
|
|
};
|
|
crypt_p1 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypted-boot-1";
|
|
settings = {
|
|
keyFile = "/etc/secrets/disks/boot-1";
|
|
allowDiscards = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
"boot-2" = {
|
|
type = "disk";
|
|
device = "${BOOT_DISK_2_ID}";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
crypt_p2 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypted-boot-2";
|
|
settings = {
|
|
keyFile = "/etc/secrets/disks/boot-2";
|
|
allowDiscards = true;
|
|
};
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [
|
|
"-d raid1"
|
|
"/dev/mapper/crypted-boot-1"
|
|
];
|
|
subvolumes = {
|
|
"/root" = {
|
|
mountpoint = "/";
|
|
mountOptions = [
|
|
"rw"
|
|
"relatime"
|
|
"ssd"
|
|
];
|
|
};
|
|
"/swap" = {
|
|
mountpoint = "none";
|
|
swap.size = "16G";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|