23 lines
693 B
Nix
23 lines
693 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.local.sys.virtualisation;
|
|
in {
|
|
options.local.sys.virtualisation = {
|
|
enable = mkEnableOption "virtualisation settings";
|
|
};
|
|
config = mkIf cfg.enable {
|
|
virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
|
|
virtualisation.libvirtd.qemu.ovmf.enable = true;
|
|
virtualisation.libvirtd.qemu.ovmf.packages = [pkgs.OVMFFull.fd];
|
|
virtualisation.libvirtd.enable = true;
|
|
# boot.kernelModules = [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
|
|
# boot.kernelParams = [ "amd_iommu=on" "iommu=pt" "vfio-pci.ids=1002:699f,1002:aae0" "video=efifb:off" ];
|
|
virtualisation.libvirtd.onBoot = "start";
|
|
};
|
|
}
|