Skip to content

Commit 7154327

Browse files
nesteroffbrianmcgillion
authored andcommitted
Refactor passthrough configuration
Signed-off-by: Yuri Nesterov <yuriy.nesterov@unikie.com>
1 parent f459299 commit 7154327

30 files changed

+648
-568
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ gcroot/
1414
.nixos-test-history
1515
uv-x86_64-unknown-linux-gnu/
1616
__pycache__/
17+
.vscode

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/hardware/common/default.nix

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
{
44
imports = [
55
./usb/external-devices.nix
6-
./usb/internal-devices.nix
7-
./usb/vhotplug.nix
8-
./usb/quirks.nix
96
./devices.nix
107
./input.nix
118
./kernel.nix

modules/hardware/common/kernel.nix

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ in
7676
# PCI device passthroughs for vfio
7777
filterDevices = builtins.filter (d: d.vendorId != null && d.productId != null);
7878
mapPciIdsToString = map (d: "${d.vendorId}:${d.productId}");
79-
vfioPciIds = mapPciIdsToString (
80-
filterDevices (
81-
config.ghaf.hardware.definition.network.pciDevices
82-
++ config.ghaf.hardware.definition.gpu.pciDevices
83-
++ config.ghaf.hardware.definition.audio.pciDevices
79+
vfioPciIds =
80+
mapPciIdsToString (
81+
filterDevices (
82+
config.ghaf.hardware.definition.network.pciDevices
83+
++ config.ghaf.hardware.definition.gpu.pciDevices
84+
++ config.ghaf.hardware.definition.audio.pciDevices
85+
)
8486
)
85-
);
87+
++ config.ghaf.hardware.definition.host.extraVfioPciIds;
8688
in
8789
config.ghaf.hardware.definition.host.kernelConfig.kernelParams
8890
++ [ "vfio-pci.ids=${builtins.concatStringsSep "," vfioPciIds}" ];

0 commit comments

Comments
 (0)