flock/suites/server/vm/default.nix

35 lines
705 B
Nix

{modulesPath, ...}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
../. # Server config.
];
# Load kernel modules.
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_scsi"
"sd_mod"
];
boot.kernelModules = ["kvm-intel"];
# Configure the bootloader.
boot.loader.grub = {
enable = true;
device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0";
};
# Root filesystem.
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
};
# Swap partition.
swapDevices = [{device = "/dev/disk/by-label/swap";}];
# Enable QEMU guest agent
services.qemuGuest.enable = true;
}