44 lines
1.4 KiB
Nix
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;
|
|
}
|