2023-11-30 18:57:58 +01:00
|
|
|
{ id, name, ... }:
|
2023-11-29 14:27:29 +01:00
|
|
|
{
|
|
|
|
disko.devices = {
|
|
|
|
disk = {
|
2023-11-30 18:57:58 +01:00
|
|
|
"${name}" = {
|
2023-11-29 14:27:29 +01:00
|
|
|
type = "disk";
|
2023-11-30 18:57:58 +01:00
|
|
|
device = "/dev/disk/by-id/${id}";
|
2023-11-29 14:27:29 +01:00
|
|
|
content = {
|
|
|
|
type = "gpt";
|
|
|
|
partitions = {
|
|
|
|
ESP = {
|
|
|
|
# Needs enough to store multiple kernel generations
|
|
|
|
size = "512M";
|
|
|
|
type = "EF00";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
|
|
|
mountOptions = [
|
|
|
|
"defaults"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
luks = {
|
|
|
|
size = "100%";
|
|
|
|
content = {
|
|
|
|
type = "luks";
|
2023-11-30 18:57:58 +01:00
|
|
|
name = "${name}";
|
2023-12-04 22:47:02 +01:00
|
|
|
passwordFile = "/tmp/secret.key"; # FIXME Generate this somehow
|
2023-11-29 14:27:29 +01:00
|
|
|
settings = {
|
|
|
|
# Not having SSDs die fast is more important than crypto
|
|
|
|
# nerds that could potentially discover which filesystem I
|
|
|
|
# use from TRIM patterns
|
|
|
|
allowDiscards = true;
|
|
|
|
};
|
|
|
|
content = {
|
|
|
|
type = "btrfs";
|
|
|
|
extraArgs = [ "-f" ];
|
|
|
|
subvolumes = {
|
|
|
|
"/nixos" = {
|
|
|
|
mountpoint = "/";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
|
|
|
"/home" = {
|
|
|
|
mountpoint = "/home";
|
|
|
|
mountOptions = [ "compress=zstd" "relatime" ];
|
|
|
|
};
|
|
|
|
"/nix" = {
|
|
|
|
mountpoint = "/nix";
|
|
|
|
mountOptions = [ "compress=zstd" "noatime" ];
|
|
|
|
};
|
|
|
|
# Maybe later
|
|
|
|
# "/swap" = {
|
|
|
|
# mountpoint = "/.swapvol";
|
|
|
|
# swap.swapfile.size = "20M";
|
|
|
|
# };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-11-30 18:57:58 +01:00
|
|
|
};
|
|
|
|
}
|