26 lines
859 B
Nix
26 lines
859 B
Nix
{ inputs, lib, ... }:
|
|
|
|
{
|
|
# Shared VM configuration
|
|
virtualisation.vmVariant = {
|
|
virtualisation.graphics = true;
|
|
virtualisation.qemu.options = [ "-device" "virtio-vga" ];
|
|
};
|
|
|
|
# Improve VM resolution and guest experience
|
|
services.spice-vdagentd.enable = true;
|
|
services.qemuGuest.enable = true;
|
|
services.xserver.videoDrivers = [ "qxl" "virtio" "modesetting" ];
|
|
|
|
# Provide the flake to the VM for local rebuilding
|
|
environment.etc."nomarchy".source = lib.mkDefault inputs.self;
|
|
|
|
# Dummy hardware config for VM
|
|
fileSystems."/" = lib.mkDefault { device = "/dev/disk/by-label/nixos"; };
|
|
boot.loader.grub.device = lib.mkDefault "/dev/vda";
|
|
boot.initrd.availableKernelModules = [ "virtio_pci" "virtio_blk" "virtio_gpu" "virtio_net" "virtio_mmio" ];
|
|
|
|
# Force early KMS for Plymouth
|
|
boot.initrd.kernelModules = [ "virtio_gpu" ];
|
|
}
|