Major rework in progress
This commit is contained in:
43
system/disko/disko_bonus.nix
Normal file
43
system/disko/disko_bonus.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{ 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;
|
||||
}
|
||||
Reference in New Issue
Block a user