added qemu host and set it as default in the config template

This commit is contained in:
Bit Borealis 2023-03-29 17:16:49 +00:00
parent 8ef470ffac
commit d1dc7fcc41
2 changed files with 45 additions and 0 deletions

6
hosts/qemu/default.nix Normal file
View File

@ -0,0 +1,6 @@
{ ... }:
{
imports = [
./hardware-configuration.nix
];
}

View File

@ -0,0 +1,39 @@
# 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.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/vda2";
fsType = "ext4";
};
fileSystems."/boot/efi" =
{ device = "/dev/vda1";
fsType = "vfat";
};
services.spice-vdagentd.enable = true;
services.spice-webdavd.enable = true;
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}