{ lib, modulesPath, ... }: { imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; config = { # Legacy BIOS boot via GRUB on the virtio disk, matching the `qemu` image # variant (`image.efiSupport = false`). The repo-wide systemd-boot default # would need an ESP plus EFI firmware and a writable varstore in the # runner, and a guest that reinstalls its own bootloader on every # `nixos-rebuild switch` is one less thing for an agent to brick. Drop that # module wholesale -- it also owns boot.loader.timeout and the EFI vars. my.systemdBoot.enable = lib.mkForce false; boot = { loader = { grub = { enable = true; devices = [ "/dev/vda" ]; }; timeout = 1; }; # The runner resizes the seeded image before first boot (the image itself # is sized to its closure), so / has to grow into the rest of the disk. growPartition = true; kernelParams = [ "console=ttyS0" ]; tmp.cleanOnBoot = true; }; # Labels, not UUIDs: every reseed makes a brand new filesystem, and the # point of this machine is being thrown away and remade. fileSystems."/" = { device = "/dev/disk/by-label/nixos"; autoResize = true; fsType = "ext4"; }; # qemu user-mode networking hands out a lease on the single virtio NIC. networking.useDHCP = lib.mkDefault true; }; }