nixos/hosts/common/disks/std-disk-config.nix

55 lines
1.4 KiB
Nix
Raw Normal View History

2024-05-16 20:19:01 +01:00
{device ? throw "Must define a device, e.g. /dev/sda"}:
2024-05-14 14:51:09 +01:00
{
disko.devices = {
2024-05-16 20:19:01 +01:00
disk.main = {
inherit device;
2024-05-14 14:51:09 +01:00
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
start = "1M";
end = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
subvolumes = {
"/root" = {
mountpoint = "/";
};
"/persist" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/persist";
};
"/nix" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/nix";
};
"/swap" = {
mountOptions = [ "noatime" ];
mountpoint = "/.swapvol";
swap.swapfile.size = "8192M";
};
};
};
};
};
};
};
};
}