From a57a6e285f05e0eea54968eac0659d245d10eea5 Mon Sep 17 00:00:00 2001 From: Dustin Frisch Date: Sat, 25 May 2024 22:55:34 +0200 Subject: [PATCH] Migrate to new disko tree format --- machines/manager/disk.nix | 45 +++++++++++++++------------------------ machines/node/disk.nix | 38 +++++++++++---------------------- 2 files changed, 30 insertions(+), 53 deletions(-) diff --git a/machines/manager/disk.nix b/machines/manager/disk.nix index ecfe528..ba5b829 100644 --- a/machines/manager/disk.nix +++ b/machines/manager/disk.nix @@ -4,46 +4,35 @@ device = "/dev/disk/by-path/pci-0000:01:00.0-scsi-0:1:1:0"; type = "disk"; content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "root"; + type = "gpt"; + partitions = { + ESP = { + start = "1MiB"; + size = "100MiB"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { start = "100MiB"; end = "-4GB"; - part-type = "primary"; - fs-type = "btrfs"; - bootable = true; content = { type = "filesystem"; format = "btrfs"; mountpoint = "/"; }; - } - { - name = "swap"; - start = "-4G"; + }; + swap = { end = "100%"; - part-type = "primary"; - fs-type = "linux-swap"; content = { type = "swap"; randomEncryption = true; }; - } - { - name = "ESP"; - start = "1MiB"; - end = "100MiB"; - fs-type = "fat32"; - bootable = true; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - } - ]; + }; + }; }; }; }; diff --git a/machines/node/disk.nix b/machines/node/disk.nix index 10bdaa3..61f306f 100644 --- a/machines/node/disk.nix +++ b/machines/node/disk.nix @@ -4,43 +4,31 @@ device = "/dev/disk/by-path/pci-0000:00:11.0-ata-1"; type = "disk"; content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "boot"; - start = "0"; - end = "1M"; - part-type = "primary"; - flags = [ "bios_grub" ]; - } - { - name = "root"; - start = "1MB"; + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + priority = 1; + }; + root = { end = "-4GB"; - part-type = "primary"; - fs-type = "btrfs"; - bootable = true; content = { type = "filesystem"; format = "btrfs"; mountpoint = "/"; extraArgs = [ "-f" ]; }; - } - { - name = "swap"; - start = "-4G"; - end = "100%"; - part-type = "primary"; - fs-type = "linux-swap"; + }; + swap = { + size = "100%"; content = { type = "swap"; randomEncryption = true; extraArgs = [ "-f" ]; }; - } - ]; + }; + }; }; }; };