nixos-config/nixos/profiles/system/disko/luks-btrfs-common.nix

70 lines
1.7 KiB
Nix

{ ... }:
{
disko.devices = {
nodev = {
"/" = {
fsType = "tmpfs";
mountOptions = [
"defaults"
"mode=755"
"nosuid"
"nodev"
];
};
};
disk = {
main = {
type = "disk";
content = {
type = "gpt";
partitions = {
esp = {
label = "ESP";
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
cryptroot = {
label = "CRYPTROOT";
size = "100%";
content = {
type = "luks";
name = "cryptroot";
settings = {
allowDiscards = true;
bypassWorkqueues = true;
crypttabExtraOpts = [
"same-cpu-crypt"
"submit-from-crypt-cpus"
];
};
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" ];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = [ "compress=zstd" ];
};
};
};
};
};
};
};
};
};
};
fileSystems."/persist".neededForBoot = true;
}