disko: Reorganize a bit
This commit is contained in:
parent
36608fa9e4
commit
3806e023f6
5 changed files with 9 additions and 141 deletions
66
dk/single_uefi_btrfs.nix
Normal file
66
dk/single_uefi_btrfs.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{ id, name, ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
"${name}" = {
|
||||
type = "disk";
|
||||
device = "/dev/disk/by-id/${id}";
|
||||
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 = "${name}";
|
||||
passwordFile = "/tmp/secret.key"; # TODO Generate this somehow
|
||||
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";
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue