69 lines
1.5 KiB
Nix
69 lines
1.5 KiB
Nix
{
|
|
disko.devices = {
|
|
nodev = {
|
|
"/" = {
|
|
fsType = "tmpfs";
|
|
mountOptions = [
|
|
"defaults"
|
|
"size=4G"
|
|
"mode=755"
|
|
"nosuid"
|
|
"nodev"
|
|
];
|
|
};
|
|
};
|
|
disk = {
|
|
main = {
|
|
type = "disk";
|
|
device = "/dev/sda";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
boot = {
|
|
type = "EF02";
|
|
label = "BOOT";
|
|
start = "0";
|
|
end = "+1M";
|
|
};
|
|
root = {
|
|
label = "ROOT";
|
|
end = "-0";
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [ "-f" ];
|
|
subvolumes = {
|
|
"boot" = {
|
|
mountpoint = "/boot";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"nix" = {
|
|
mountpoint = "/nix";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"persist" = {
|
|
mountpoint = "/persist";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
fileSystems."/persist".neededForBoot = true;
|
|
|
|
environment.globalPersistence = {
|
|
enable = true;
|
|
root = "/persist";
|
|
};
|
|
|
|
services.btrfs.autoScrub = {
|
|
enable = true;
|
|
interval = "weekly";
|
|
fileSystems = [ "/persist" ];
|
|
};
|
|
}
|