82 lines
2 KiB
Nix
82 lines
2 KiB
Nix
{
|
|
disko.devices = {
|
|
nodev = {
|
|
"/" = {
|
|
fsType = "tmpfs";
|
|
mountOptions = [
|
|
"defaults"
|
|
"size=8G"
|
|
"mode=755"
|
|
"nosuid"
|
|
"nodev"
|
|
];
|
|
};
|
|
};
|
|
disk = {
|
|
main = {
|
|
type = "disk";
|
|
device = "/dev/disk/by-path/pci-0000:04:00.0-nvme-1";
|
|
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 = {
|
|
"/persist" = {
|
|
mountpoint = "/persist";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"/nix" = {
|
|
mountpoint = "/nix";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
fileSystems."/persist".neededForBoot = true;
|
|
|
|
environment.globalPersistence = {
|
|
enable = true;
|
|
root = "/persist";
|
|
};
|
|
|
|
services.btrfs.autoScrub = {
|
|
enable = true;
|
|
interval = "weekly";
|
|
fileSystems = [ "/persist" ];
|
|
};
|
|
}
|