From 09457c8055cb69129228d5cf89159cd1a27295e9 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 15 May 2025 10:54:57 +0200 Subject: [PATCH] Update disk-config --- disk-config.nix | 145 ++++++++++++++++++++++++++---------------------- 1 file changed, 80 insertions(+), 65 deletions(-) diff --git a/disk-config.nix b/disk-config.nix index 6ef19e3..efab79e 100644 --- a/disk-config.nix +++ b/disk-config.nix @@ -1,75 +1,90 @@ { - disko.devices = - let - mirrorContent = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "mdraid"; - name = "boot"; + disko.devices = { + disk = { + one = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + BOOT = { + size = "1M"; + type = "EF02"; # for grub MBR }; - }; - primary = { - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - in - { - disk = { - one = { - type = "disk"; - device = "/dev/nvme0n1"; - content = mirrorContent; - }; - two = { - type = "disk"; - device = "/dev/nvme1n1"; - content = mirrorContent; - }; - }; - mdadm = { - boot = { - type = "mdadm"; - level = 1; - metadata = "1.0"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ "umask=0077" ]; - }; - }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%"; - lvm_type = "mirror"; + ESP = { + size = "500M"; + type = "EF00"; content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - mountOptions = [ - "defaults" - ]; + type = "mdraid"; + name = "boot"; + }; + }; + mdadm = { + size = "100%"; + content = { + type = "mdraid"; + name = "raid1"; + }; + }; + }; + }; + }; + two = { + type = "disk"; + device = "/dev/sdb"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + ESP = { + size = "500M"; + type = "EF00"; + content = { + type = "mdraid"; + name = "boot"; + }; + }; + mdadm = { + size = "100%"; + content = { + type = "mdraid"; + name = "raid1"; }; }; }; }; }; }; + mdadm = { + boot = { + type = "mdadm"; + level = 1; + metadata = "1.0"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + raid1 = { + type = "mdadm"; + level = 1; + content = { + type = "gpt"; + partitions.primary = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; }