diff --git a/disk-configs/luks-lvm.nix b/disk-configs/luks-lvm.nix new file mode 100644 index 0000000..af08719 --- /dev/null +++ b/disk-configs/luks-lvm.nix @@ -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"; + }; + }; + }; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix index 24d40d7..3da990b 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,7 @@ disko.nixosModules.disko ./disk-configs/simple-efi.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 = { efiSupport = true;