From 1c07fd9fb93ecb458b4c165a3cd6796773e2e709 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 15 May 2025 10:18:40 +0200 Subject: [PATCH] Update disk-config --- disk-config.nix | 143 ++++++++++++++++++++++-------------------------- 1 file changed, 66 insertions(+), 77 deletions(-) diff --git a/disk-config.nix b/disk-config.nix index 1fae265..6ef19e3 100644 --- a/disk-config.nix +++ b/disk-config.nix @@ -1,86 +1,75 @@ { - disko.devices = { - disk = { - one = { - type = "disk"; - device = "/dev/nvme0n1"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "500M"; - type = "EF00"; - content = { - type = "mdraid"; - name = "boot"; - }; - }; - primary = { - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; + disko.devices = + let + mirrorContent = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR }; - }; - }; - two = { - type = "disk"; - device = "/dev/nvme1n1"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "500M"; - type = "EF00"; - content = { - type = "mdraid"; - name = "boot"; - }; - }; - primary = { - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - }; - }; - 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"; + }; + }; + 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"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; }; }; }; }; }; - }; }