From 65bd5a97f8dddaa6710df085cfd643d8eefead38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 4 Sep 2022 12:44:38 +0200 Subject: add test for lvm example --- example/config.nix | 117 ++++++++++++++++++++++++++++------------------------- 1 file changed, 62 insertions(+), 55 deletions(-) (limited to 'example') diff --git a/example/config.nix b/example/config.nix index 1a64b1c..f75ec63 100644 --- a/example/config.nix +++ b/example/config.nix @@ -1,67 +1,74 @@ # usage: nix-instantiate --eval --json --strict example/config.nix | jq . { - type = "devices"; - content = { - sda = { - type = "table"; - format = "gpt"; - partitions = [ - { - type = "partition"; - part-type = "ESP"; - start = "1MiB"; - end = "1024MiB"; - fs-type = "fat32"; - bootable = true; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + type = "lv"; + size = "10G"; content = { type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; + format = "ext4"; + mountpoint = "/"; }; - } - { - type = "partition"; - part-type = "primary"; - start = "1024MiB"; - end = "100%"; - flags = [ "bios_grub" ]; + }; + home = { + type = "lv"; + size = "10G"; content = { - type = "luks"; - algo = "aes-xts..."; - name = "crypted"; - keyfile = "/tmp/secret.key"; - extraArgs = [ - "--hash sha512" - "--iter-time 5000" - ]; + type = "filesystem"; + format = "ext4"; + mountpoint = "/home"; + }; + }; + }; + }; + }; + disk = { + sda = { + device = "/dev/sda"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "boot"; + type = "partition"; + part-type = "ESP"; + start = "1MiB"; + end = "1024MiB"; + fs-type = "fat32"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "crypt_root"; + type = "partition"; + part-type = "primary"; + start = "1024MiB"; + end = "100%"; + flags = ["bios_grub"]; content = { - type = "lvm"; - name = "pool"; - lvs = { - root = { - type = "lv"; - size = "10G"; - mountpoint = "/"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - home = { - type = "lv"; - size = "10G"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/home"; - }; - }; + type = "luks"; + name = "crypted"; + keyFile = "/tmp/secret.key"; + extraArgs = [ + "--hash sha512" + "--iter-time 5000" + ]; + content = { + type = "lvm_pv"; + vg = "pool"; }; }; - }; - } - ]; + } + ]; + }; }; }; } -- cgit v1.2.3