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 16:41:35 +00:00
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
2023-11-04 11:54:07 +00: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 06:11:01 +00:00
additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "100M";
2022-08-25 16:36:56 +00:00
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [
2022-08-25 16:36:56 +00:00
"defaults"
];
};
};
home = {
size = "10M";
2022-08-25 16:36:56 +00:00
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
2022-08-25 16:36:56 +00:00
};
};
raw = {
size = "10M";
2022-08-25 16:36:56 +00:00
};
};
};
2022-08-25 16:36:56 +00:00
};
};
}