dotfiles/common/disko/single_uefi_btrfs.nix

83 lines
2.2 KiB
Nix
Raw Normal View History

2024-12-15 00:29:51 +01:00
{
pkgs,
lib,
config,
...
}:
2024-02-17 18:39:09 +01:00
let
passwordFile = "/tmp/dotfiles_${config.frogeye.name}_password";
2024-02-17 18:39:09 +01:00
in
2023-11-29 14:27:29 +01:00
{
disko.devices = {
disk = {
"${config.frogeye.name}" = {
2023-11-29 14:27:29 +01:00
type = "disk";
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";
name = "${config.frogeye.name}";
2023-12-09 00:09:36 +01:00
passwordFile = passwordFile;
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 = "/";
2024-12-15 00:29:51 +01:00
mountOptions = [
"compress=zstd"
"noatime"
];
2023-11-29 14:27:29 +01:00
};
"/home" = {
mountpoint = "/home";
2024-12-15 00:29:51 +01:00
mountOptions = [
"compress=zstd"
"relatime"
];
2023-11-29 14:27:29 +01:00
};
"/nix" = {
mountpoint = "/nix";
2024-12-15 00:29:51 +01:00
mountOptions = [
"compress=zstd"
"noatime"
];
2023-11-29 14:27:29 +01:00
};
# Maybe later
# "/swap" = {
# mountpoint = "/.swapvol";
# swap.swapfile.size = "20M";
# };
};
};
};
};
};
};
};
};
2023-11-30 18:57:58 +01:00
};
}