disko/example/luks-lvm.nix

76 lines
1.8 KiB
Nix
Raw Normal View History

{
disko.devices = {
disk = {
vdb = {
type = "disk";
device = "/dev/vdb";
content = {
type = "gpt";
partitions = {
ESP = {
size = "500M";
2023-07-20 19:41:35 +03:00
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
2023-11-04 14:54:07 +03:00
extraOpenArgs = [ ];
settings = {
# 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`
keyFile = "/tmp/secret.key";
allowDiscards = true;
};
2023-08-11 09:11:01 +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
};
};
}