From 5a4be399887fd080a5c4600166d29d5279b843c7 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 8 Sep 2025 15:36:40 +0000 Subject: [PATCH] Second attempt at disk config using example I based this heavily off of https://github.com/nix-community/disko/blob/c8a0e78d86b12ea67be6ed0f7cae7f9bfabae75a/example/gpt-bios-compat.nix --- nixos-anywhere-nocix/disk-config.nix | 80 ++++++++++------------------ 1 file changed, 28 insertions(+), 52 deletions(-) diff --git a/nixos-anywhere-nocix/disk-config.nix b/nixos-anywhere-nocix/disk-config.nix index 75ae234..1894dde 100644 --- a/nixos-anywhere-nocix/disk-config.nix +++ b/nixos-anywhere-nocix/disk-config.nix @@ -1,56 +1,32 @@ # Example to create a bios compatible gpt partition { lib, ... }: { - disko.devices = { - disk.disk1 = { - device = lib.mkDefault "/dev/sda"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - name = "boot"; - size = "1M"; - type = "EF02"; - }; - esp = { - name = "ESP"; - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - name = "root"; - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; - }; - }; - }; - }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%FREE"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - mountOptions = [ - "defaults" - ]; - }; - }; - }; - }; - }; - }; + disko.devices = { + disk = { + sdb = { + device = "/dev/sdb"; + type = "disk"; + content = { + type = "table"; + format = "mbr"; + partitions = { + boot = { + size = "500M"; + type = "EF02"; # for grub MBR + attributes = [ 0 ]; # partition attribute + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + + }; + }; + }; + }; + }; }