{ config, lib, pkgs, modulesPath, ... }: # Contains the configuration to make a VM bootable with qemu. { imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ]; boot = { kernelParams = [ "boot.shell_on_fail" ]; #kernelPackages = lib.mkForce pkgs.linuxPackagesCustom; consoleLogLevel = lib.mkDefault 7; initrd.kernelModules = [ "virtio_pci" "virtio_blk" "virtio_input" "9pnet" "9pnet_virtio" ]; kernelPatches = [ { name = "qemu"; patch = null; extraConfig = '' # For qemu BLOCK y BLK_DEV y DEVTMPFS y VIRTIO_MENU y VIRTIO_BLK y VIRTIO_NET y EXT4_FS y # For 9P: https://wiki.qemu.org/Documentation/9psetup NET_9P y NET_9P_VIRTIO y NET_9P_DEBUG y NET_DEVICES y NET_CORE y INET y NETWORK_FILESYSTEMS y OVERLAY_FS y "9P_FS" y "9P_FS_POSIX_ACL" y PCI y VIRTIO_PCI y PCI_HOST_GENERIC y ''; } ]; loader = { grub.enable = false; generic-extlinux-compatible.enable = true; }; }; }