nix-config/lib/disk-config.nix
Lander Van den Bulcke b3c5b0c362
refactor: standardize hetzner machines
Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
2025-09-18 23:42:15 +02:00

52 lines
1.2 KiB
Nix

{
disks ? [ "/dev/sda" ],
nixpkgs,
...
}:
{
disko.devices = {
disk = nixpkgs.lib.genAttrs disks (disk: {
device = disk;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "256M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
main = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # override existing partition
subvolumes = {
"/" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/";
};
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [
"compress=zstd"
"noatime"
];
mountpoint = "/nix";
};
};
};
};
};
};
});
};
}