75 lines
1.9 KiB
Nix
75 lines
1.9 KiB
Nix
{ lib, ... }:
|
|
{
|
|
disko.devices = {
|
|
disk = {
|
|
"system-1" = {
|
|
type = "disk";
|
|
device = "${BOOT_DISK_1}";
|
|
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-disk-2";
|
|
allowDiscards = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
"system-2" = {
|
|
type = "disk";
|
|
device = "${BOOT_DISK_2}";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
crypt_p2 = {
|
|
size = "100%";
|
|
content = {
|
|
type = "luks";
|
|
name = "crypted-boot-2";
|
|
settings = {
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|