diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2022-09-04 12:11:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-04 12:11:54 +0100 |
commit | fbc08430d28a65eb3e783feb892659d32abd4551 (patch) | |
tree | cba2f7972cb82ff445e68383a46927c8a25ec763 /example/lvm-raid.nix | |
parent | adf901d58155ca268d15351fff164d3ef38a0890 (diff) | |
parent | 68f950bf2045573b03cd0e1ceebe7131ea999873 (diff) |
Merge pull request #31 from nix-community/types
Reimplement using types
Diffstat (limited to 'example/lvm-raid.nix')
-rw-r--r-- | example/lvm-raid.nix | 112 |
1 files changed, 60 insertions, 52 deletions
diff --git a/example/lvm-raid.nix b/example/lvm-raid.nix index 48930ec..3c5ee69 100644 --- a/example/lvm-raid.nix +++ b/example/lvm-raid.nix @@ -1,66 +1,74 @@ { - type = "devices"; - content = { + disk = { vdb = { - type = "table"; - format = "gpt"; - partitions = [ - { - type = "partition"; - part-type = "primary"; - start = "0%"; - end = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - } - ]; + type = "disk"; + device = "/dev/vdb"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "primary"; + start = "0%"; + end = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + } + ]; + }; }; vdc = { - type = "table"; - format = "gpt"; - partitions = [ - { - type = "partition"; - part-type = "primary"; - start = "0%"; - end = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - } - ]; + type = "disk"; + device = "/dev/vdc"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "primary"; + start = "0%"; + end = "100%"; + content = { + type = "lvm_pv"; + vg = "pool"; + }; + } + ]; + }; }; + }; + lvm_vg = { pool = { type = "lvm_vg"; - lvs = { - root = { - type = "lvm_lv"; - size = "100M"; + lvs = { + root = { + type = "lvm_lv"; + size = "100M"; + lvm_type = "mirror"; + content = { + type = "filesystem"; + format = "ext4"; mountpoint = "/"; - lvm_type = "mirror"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - options = [ - "defaults" - ]; - }; + options = [ + "defaults" + ]; }; - home = { - type = "lvm_lv"; - size = "10M"; - lvm_type = "raid0"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/home"; - }; + }; + home = { + type = "lvm_lv"; + size = "10M"; + lvm_type = "raid0"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/home"; }; }; + }; }; }; } |