From 444ede207411e6ed240b76952f79bb7932344050 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:19:14 -0600 Subject: [PATCH] try using disko to format for nixos-anywhere --- hosts/aarch64-linux/flame/default.nix | 72 +++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 9 deletions(-) diff --git a/hosts/aarch64-linux/flame/default.nix b/hosts/aarch64-linux/flame/default.nix index 5d74619..c6adf3b 100644 --- a/hosts/aarch64-linux/flame/default.nix +++ b/hosts/aarch64-linux/flame/default.nix @@ -61,16 +61,16 @@ rec { # Taken from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/oci-common.nix - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - autoResize = true; - }; + # fileSystems."/" = { + # device = "/dev/disk/by-label/nixos"; + # fsType = "ext4"; + # autoResize = true; + # }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/ESP"; - fsType = "vfat"; - }; + # fileSystems."/boot" = { + # device = "/dev/disk/by-label/ESP"; + # fsType = "vfat"; + # }; boot.loader.efi.canTouchEfiVariables = false; boot.loader.grub = { @@ -90,6 +90,60 @@ rec { services.openssh.enable = true; + # Example to create a bios compatible gpt partition + disko.devices = { + disk.disk1 = { + device = "/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" + ]; + }; + }; + }; + }; + }; + }; + # # Otherwise the instance may not have a working network-online.target, # # making the fetch-ssh-keys.service fail # networking.useNetworkd = true;