Global: add qemu virt stuff & prepare for pcie passtrough

This commit is contained in:
blahai 2024-10-28 13:19:32 +02:00
parent c7d7ed6734
commit 4b26899d0e
Signed by: blahai
SSH key fingerprint: SHA256:ZfCryi+V64yG+vC1ZIIsqgvBCmA31tTi7RJ6M8CvpRc
2 changed files with 35 additions and 0 deletions

View file

@ -3,5 +3,6 @@
./catppuccin.nix ./catppuccin.nix
./games/default.nix ./games/default.nix
./services/default.nix ./services/default.nix
./virtualisation.nix
]; ];
} }

View file

@ -0,0 +1,34 @@
{ pkgs, lib, config, ... }:
let
platform = "amd";
vfioIds = [ "" "" ];
in {
boot = {
kernelModules = [ "kvm-${platform}" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ];
kernelParams = [ "${platform}_iommu=on" "${platform}_iommu=pt" "kvm.ignore_msrs=1" ];
extraModprobeConfig = "options vfio-pci ids=${builtins.concatStringsSep "," vfioIds}";
};
virtualisation = {
libvirtd = {
enable = true;
onBoot = "ignore";
onShutdown = "shutdown";
};
qemu = {
package = pkgs.qemu_kvm;
ovmf.enable = true;
};
docker = {
enable = true;
};
};
environment.systemPackages = with pkgs; [
virt-manager
];
}