try using disko to format for nixos-anywhere

This commit is contained in:
Noah Masur
2025-07-01 18:19:14 -06:00
parent c31fe46b61
commit 444ede2074

View File

@ -61,16 +61,16 @@ rec {
# Taken from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/oci-common.nix # Taken from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/oci-common.nix
fileSystems."/" = { # fileSystems."/" = {
device = "/dev/disk/by-label/nixos"; # device = "/dev/disk/by-label/nixos";
fsType = "ext4"; # fsType = "ext4";
autoResize = true; # autoResize = true;
}; # };
fileSystems."/boot" = { # fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP"; # device = "/dev/disk/by-label/ESP";
fsType = "vfat"; # fsType = "vfat";
}; # };
boot.loader.efi.canTouchEfiVariables = false; boot.loader.efi.canTouchEfiVariables = false;
boot.loader.grub = { boot.loader.grub = {
@ -90,6 +90,60 @@ rec {
services.openssh.enable = true; 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, # # Otherwise the instance may not have a working network-online.target,
# # making the fetch-ssh-keys.service fail # # making the fetch-ssh-keys.service fail
# networking.useNetworkd = true; # networking.useNetworkd = true;