Files
Olympus/system/disko/disko_bonus.nix
2024-10-10 11:01:59 -05:00

44 lines
1.4 KiB
Nix

{ devices ? throw "Set this to an attribute set of your devices e.g. { disk1 = \"/dev/sda\"; }", ... }: {
disko.devices = builtins.mapAttrs (name: device: {
disk.${name} = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
${name} = {
name = "${name}";
size = "100%";
content = {
type = "lvm_pv";
vg = "$name_vg";
};
};
};
};
};
lvm_vg = {
"${name}_vg" = {
type = "lvm_vg";
lvs = {
${name} = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/${name}" = {
mountOptions = [ "subvol=${name}" "noatime" ];
mountpoint = "/${name}";
};
};
};
};
};
};
};
}) devices;
}