From b6f43b8795bd283f52d3a9eba25d1c6f01cf70e4 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 8 Sep 2025 16:02:30 +0000 Subject: [PATCH] Try a different disk layout with LVM This is based on a discussion here: https://github.com/nix-community/disko/issues/889 Had to do it since the last one didn't even build and was based on a cobbling of LLM (Claude) assistance, reading example files, and reading the disko module definition file. --- nixos-anywhere-nocix/disk-config.nix | 53 +++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/nixos-anywhere-nocix/disk-config.nix b/nixos-anywhere-nocix/disk-config.nix index 1894dde..a1481de 100644 --- a/nixos-anywhere-nocix/disk-config.nix +++ b/nixos-anywhere-nocix/disk-config.nix @@ -7,23 +7,60 @@ device = "/dev/sdb"; type = "disk"; content = { - type = "table"; - format = "mbr"; + type = "gpt"; partitions = { + MBR = { + size = "1M"; + type = "EF02"; # for grub MBR + }; boot = { size = "500M"; - type = "EF02"; # for grub MBR - attributes = [ 0 ]; # partition attribute + type = "EF00"; # for grub MBR + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; }; root = { size = "100%"; content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; + type = "lvm_pv"; + vg = "pool"; }; }; - + }; + }; + }; + }; + lvm_vg = { + pool = { + type = "lvm_vg"; + lvs = { + root = { + size = "50G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + var = { + size = "100%FREE"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/var"; + mountOptions = [ + "defaults" + ]; + }; }; }; };