mirror of
https://github.com/blahai/nyx.git
synced 2025-01-18 19:10:21 +00:00
Global: add qemu virt stuff & prepare for pcie passtrough
This commit is contained in:
parent
c7d7ed6734
commit
4b26899d0e
2 changed files with 35 additions and 0 deletions
|
@ -3,5 +3,6 @@
|
|||
./catppuccin.nix
|
||||
./games/default.nix
|
||||
./services/default.nix
|
||||
./virtualisation.nix
|
||||
];
|
||||
}
|
||||
|
|
34
modules/nixos/virtualisation.nix
Normal file
34
modules/nixos/virtualisation.nix
Normal 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
|
||||
];
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue