disko/example/luks-lvm.nix

72 lines
1.7 KiB
Nix
Raw Normal View History

{
disko.devices = {
disk = {
vdb = {
type = "disk";
device = "/dev/vdb";
content = {
type = "gpt";
partitions = {
ESP = {
size = "100M";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
2023-04-30 14:59:54 +03:00
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
settings.keyFile = "/tmp/secret.key";
2023-07-06 21:33:44 +03:00
additionalKeyFiles = ["/tmp/additionalSecret.key"];
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100M";
2022-08-25 19:36:56 +03:00
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
2022-08-25 19:36:56 +03:00
"defaults"
];
};
};
home = {
size = "10M";
2022-08-25 19:36:56 +03:00
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
2022-08-25 19:36:56 +03:00
};
};
raw = {
size = "10M";
2022-08-25 19:36:56 +03:00
};
};
};
2022-08-25 19:36:56 +03:00
};
};
}