From c20b0628b9385e1c00fbde64beec559bab724f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 15 Aug 2023 13:41:08 +0200 Subject: [PATCH] add lvm example --- disk-configs/luks-lvm.nix | 62 +++++++++++++++++++++++++++++++++++++++ flake.nix | 1 + 2 files changed, 63 insertions(+) create mode 100644 disk-configs/luks-lvm.nix 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;