diff --git a/hosts/buildbox/configuration.nix b/hosts/buildbox/configuration.nix index a207d50..12de430 100644 --- a/hosts/buildbox/configuration.nix +++ b/hosts/buildbox/configuration.nix @@ -17,9 +17,10 @@ inputs.home-manager.nixosModules.default ]; - # Bootloader. + # Bootloader. SeaBIOS/BIOS boot via GRUB installed to the whole disk + # (writes boot.img to the MBR, core.img to the EF02 partition). boot.loader.grub.enable = lib.mkDefault true; - boot.loader.grub.devices = ["nodev"]; + boot.loader.grub.devices = ["/dev/sda"]; nix.settings.experimental-features = ["nix-command" "flakes"]; diff --git a/hosts/buildbox/disko-config.nix b/hosts/buildbox/disko-config.nix index d66fc3f..51fee39 100644 --- a/hosts/buildbox/disko-config.nix +++ b/hosts/buildbox/disko-config.nix @@ -13,6 +13,17 @@ content = { type = "gpt"; partitions = { + # GRUB's core.img lives here on GPT/BIOS systems (GPT leaves no + # gap after the MBR, so grub-install needs an EF02 partition). + # Not mounted; grub-install writes the boot code directly. + boot = { + size = "1M"; + type = "EF02"; + content = { + type = "filesystem"; + format = "empty"; + }; + }; root = { size = "100%"; content = { diff --git a/hosts/buildbox/hardware-configuration.nix b/hosts/buildbox/hardware-configuration.nix index c8fa53f..abb9d63 100644 --- a/hosts/buildbox/hardware-configuration.nix +++ b/hosts/buildbox/hardware-configuration.nix @@ -1,6 +1,15 @@ -# Do not modify this file! It was generated by 'nixos-generate-config' -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. +# Hardware profile for buildbox (QEMU/KVM VM). +# +# Filesystems, swap, and boot-related disk config are intentionally NOT +# declared here — they are owned by disko via ./disko-config.nix, which +# sets config.fileSystems / config.swapDevices / config.boot when +# disko.enableConfig = true (the default). Keep this file limited to +# kernel modules and platform settings that disko does not manage. +# +# This file is still regenerated by `nixos-anywhere --generate-hardware-config +# nixos-generate-config ./hosts/buildbox/hardware-configuration.nix`, so any +# hand-edits here may be overwritten on the next install. The disko-owned +# filesystem entries below are stripped on purpose; do not re-add them. { config, lib, @@ -17,47 +26,7 @@ boot.kernelModules = []; boot.extraModulePackages = []; - fileSystems."/" = { - device = "/dev/disk/by-partuuid/REPLACE-ME"; - fsType = "btrfs"; - options = ["subvol=root" "compress=zstd" "noatime"]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-partuuid/REPLACE-ME"; - fsType = "btrfs"; - options = ["subvol=home" "compress=zstd" "noatime"]; - }; - - fileSystems."/nix" = { - device = "/dev/disk/by-partuuid/REPLACE-ME"; - fsType = "btrfs"; - options = ["subvol=nix" "compress=zstd" "noatime"]; - }; - - fileSystems."/var/log" = { - device = "/dev/disk/by-partuuid/REPLACE-ME"; - fsType = "btrfs"; - options = ["subvol=var-log" "compress=zstd" "noatime"]; - neededForBoot = false; - }; - - fileSystems."/.snapshots" = { - device = "/dev/disk/by-partuuid/REPLACE-ME"; - fsType = "btrfs"; - options = ["subvol=snapshots" "compress=zstd" "noatime"]; - neededForBoot = false; - }; - - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 4 * 1024; - } - ]; - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;