add lvm example

This commit is contained in:
Jörg Thalheim 2023-08-15 13:41:08 +02:00
parent 9b4d0d6c2e
commit c20b0628b9
2 changed files with 63 additions and 0 deletions

62
disk-configs/luks-lvm.nix Normal file
View File

@ -0,0 +1,62 @@
{
disko.devices = {
disk = {
disk1 = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
extraOpenArgs = [ "--allow-discards" ];
# 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";
content = {
type = "lvm_pv";
vg = "pool";
};
};
};
};
};
};
};
lvm_vg = {
pool = {
type = "lvm_vg";
lvs = {
root = {
size = "30G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
home = {
size = "30G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
};
};
};
};
};
};
}

View File

@ -22,6 +22,7 @@
disko.nixosModules.disko disko.nixosModules.disko
./disk-configs/simple-efi.nix # choose your favorite disk layout here ./disk-configs/simple-efi.nix # choose your favorite disk layout here
#./disk-configs/zfs.nix # choose your favorite disk layout here #./disk-configs/zfs.nix # choose your favorite disk layout here
#./disk-configs/luks-lvm.nix # choose your favorite disk layout here
{ {
boot.loader.grub = { boot.loader.grub = {
efiSupport = true; efiSupport = true;