2022-10-21 12:43:55 +00:00
|
|
|
{ disks ? [ "/dev/vdb" ], ... }: {
|
2022-08-29 09:45:19 +00:00
|
|
|
disk = {
|
2022-08-25 11:14:07 +00:00
|
|
|
vdb = {
|
2022-08-29 09:45:19 +00:00
|
|
|
type = "disk";
|
2022-09-30 10:55:28 +00:00
|
|
|
device = builtins.elemAt disks 0;
|
2022-08-29 09:45:19 +00:00
|
|
|
content = {
|
|
|
|
type = "table";
|
|
|
|
format = "gpt";
|
|
|
|
partitions = [
|
|
|
|
{
|
|
|
|
type = "partition";
|
|
|
|
name = "ESP";
|
|
|
|
start = "1MiB";
|
|
|
|
end = "100MiB";
|
|
|
|
bootable = true;
|
2022-08-25 16:36:56 +00:00
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
2022-08-29 09:45:19 +00:00
|
|
|
format = "vfat";
|
|
|
|
mountpoint = "/boot";
|
2022-12-16 21:32:44 +00:00
|
|
|
mountOptions = [
|
2022-08-25 16:36:56 +00:00
|
|
|
"defaults"
|
|
|
|
];
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
type = "partition";
|
|
|
|
name = "luks";
|
|
|
|
start = "100MiB";
|
|
|
|
end = "100%";
|
2022-08-25 16:36:56 +00:00
|
|
|
content = {
|
2022-08-29 09:45:19 +00:00
|
|
|
type = "luks";
|
|
|
|
name = "crypted";
|
2023-03-21 18:41:39 +00:00
|
|
|
extraOpenArgs = [ "--allow-discards" ];
|
2022-08-29 09:45:19 +00:00
|
|
|
keyFile = "/tmp/secret.key";
|
|
|
|
content = {
|
|
|
|
type = "lvm_pv";
|
|
|
|
vg = "pool";
|
|
|
|
};
|
2022-08-25 16:36:56 +00:00
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
lvm_vg = {
|
|
|
|
pool = {
|
|
|
|
type = "lvm_vg";
|
|
|
|
lvs = {
|
|
|
|
root = {
|
|
|
|
type = "lvm_lv";
|
|
|
|
size = "100M";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/";
|
2022-12-16 21:32:44 +00:00
|
|
|
mountOptions = [
|
2022-08-29 09:45:19 +00:00
|
|
|
"defaults"
|
|
|
|
];
|
2022-08-25 16:36:56 +00:00
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
};
|
|
|
|
home = {
|
|
|
|
type = "lvm_lv";
|
|
|
|
size = "10M";
|
|
|
|
content = {
|
|
|
|
type = "filesystem";
|
|
|
|
format = "ext4";
|
|
|
|
mountpoint = "/home";
|
2022-08-25 16:36:56 +00:00
|
|
|
};
|
|
|
|
};
|
2022-08-29 09:45:19 +00:00
|
|
|
raw = {
|
|
|
|
type = "lvm_lv";
|
|
|
|
size = "10M";
|
|
|
|
};
|
|
|
|
};
|
2022-08-25 16:36:56 +00:00
|
|
|
};
|
2022-08-25 11:14:07 +00:00
|
|
|
};
|
|
|
|
}
|