This commit is contained in:
notgne2 2022-06-11 11:37:58 -07:00
parent ac021ac976
commit 91eea7811a
No known key found for this signature in database
GPG key ID: 5CE0A245A2DAC84A
9 changed files with 259 additions and 256 deletions

View file

@ -1,13 +1,10 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.ezpassthru;
in
{
let cfg = config.services.ezpassthru;
in {
options.services.ezpassthru = {
enable =
mkEnableOption
"Enable simple VM PCI passthrough config (NOTE: this is only for ppl with a primary AMD/Intel, and a non-primary NVidia)";
enable = mkEnableOption
"Enable simple VM PCI passthrough config (NOTE: this is only for ppl with a primary AMD/Intel, and a non-primary NVidia)";
PCIs = mkOption {
description = "The ID pairs of your PCI devices to passthrough";
@ -29,11 +26,7 @@ in
"vfio"
];
boot.kernelParams = [
"intel_iommu=on"
"amd_iommu=on"
"pcie_aspm=off"
];
boot.kernelParams = [ "intel_iommu=on" "amd_iommu=on" "pcie_aspm=off" ];
boot.extraModprobeConfig = "options vfio-pci ids=${
builtins.concatStringsSep "," (builtins.attrNames cfg.PCIs)