115 lines
2.2 KiB
Nix
115 lines
2.2 KiB
Nix
{
|
|
device1 ? throw "Set this to your disk device, e.g. /dev/sda",
|
|
device2,
|
|
...
|
|
}: {
|
|
disko.devices = {
|
|
disk = {
|
|
main = {
|
|
device = device1;
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
boot = {
|
|
name = "boot";
|
|
size = "1M";
|
|
type = "EF02";
|
|
};
|
|
esp = {
|
|
name = "ESP";
|
|
size = "500M";
|
|
type = "EF00";
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
};
|
|
};
|
|
swap = {
|
|
size = "4G";
|
|
content = {
|
|
type = "swap";
|
|
resumeDevice = true;
|
|
};
|
|
};
|
|
root = {
|
|
name = "root";
|
|
size = "100%";
|
|
content = {
|
|
type = "lvm_pv";
|
|
vg = "root_vg";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
ssd1 = {
|
|
device = device2;
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ssd1 = {
|
|
name = "ssd1";
|
|
size = "100%";
|
|
content = {
|
|
type = "lvm_pv";
|
|
vg = "ssd1_vg";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
lvm_vg = {
|
|
root_vg = {
|
|
type = "lvm_vg";
|
|
lvs = {
|
|
root = {
|
|
size = "100%FREE";
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = ["-f"];
|
|
|
|
subvolumes = {
|
|
"/root" = {
|
|
mountpoint = "/";
|
|
};
|
|
|
|
"/persist" = {
|
|
mountOptions = ["subvol=persist" "noatime"];
|
|
mountpoint = "/persist";
|
|
};
|
|
|
|
"/nix" = {
|
|
mountOptions = ["subvol=nix" "noatime"];
|
|
mountpoint = "/nix";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
ssd1_vg = {
|
|
type = "lvm_vg";
|
|
lvs = {
|
|
ssd1 = {
|
|
size = "100%FREE";
|
|
content = {
|
|
type = "btrfs";
|
|
extraArgs = [ "-f" ];
|
|
subvolumes = {
|
|
"/ssd1" = {
|
|
mountOptions = [ "subvol=ssd1" "noatime" ];
|
|
mountpoint = "/ssd1";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|