nixos-config/machines/odin/storage.nix
Erwin Boskma 3ecb99ac34
Enable LVM, make sure data partition is created last
There are suggestions to add a way to set the order without the need to prefix
attribute names.

See https://github.com/nix-community/disko/issues/80
2023-01-17 15:53:06 +01:00

104 lines
2.2 KiB
Nix

{ disko, ... }:
{
disko.devices = {
disk = {
sda = {
device = "/dev/vda";
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "boot";
start = "1MiB";
end = "512MiB";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
}
{
type = "partition";
name = "root_pv_sda";
start = "512MiB";
end = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
}
];
};
};
sdb = {
device = "/dev/vdb";
type = "disk";
content = {
type = "table";
format = "gpt";
partitions = [
{
type = "partition";
name = "root_pv_sdb";
start = "0%";
end = "100%";
content = {
type = "lvm_pv";
vg = "pool";
};
}
];
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "32GiB";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
swap = {
size = "8GiB";
content = {
type = "swap";
randomEncryption = false;
};
};
zz_data = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/data";
mountOptions = [ "defaults" ];
};
};
};
};
};
};
# fileSystems."/" = {
# device = "/dev/disk/by-label/nixos";
# fsType = "ext4";
# };
# fileSystems."/data" = {
# device = "/dev/disk/by-label/data";
# fsType = "btrfs";
# };
}