Skip to content

Commit

Permalink
chungus: we doin vfio again
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Dec 13, 2024
1 parent 3f9f8b8 commit db7b623
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
24 changes: 21 additions & 3 deletions machines/chungus/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
inputs:
{ config, pkgs, lib, ... }:
with lib; {
let
mkGpu = { video, audio }: {
inherit video audio;
pciDevs = [ video audio ];
};
mainGpu = mkGpu {
video = "10de:2482";
audio = "10de:228b";
};
backupGpu = mkGpu {
video = "10de:1cb6";
audio = "10de:0fb9";
};
in with lib; {
imports = [
./hardware-configuration.nix
"${inputs.nixos-hardware}/common/cpu/amd"
Expand All @@ -12,9 +25,9 @@ with lib; {
astral.tailscale.oneOffKey =
"tskey-auth-kCDetm2CNTRL-3bYunP5bKyUL7q7gdE9DxUHjinjQuZPZ";
astral.vfio = {
enable = true;
enable = false;
iommu-mode = "amd_iommu";
pci-devs = [ ];
pci-devs = mainGpu.pciDevs;
};

# so i can be a *gamer*
Expand Down Expand Up @@ -77,5 +90,10 @@ with lib; {
hardware.nvidia.open = true;

services.xserver.dpi = 224;

specialisation."VFIO".configuration = {
system.nixos.tags = [ "with-vfio" ];
astral.vfio.enable = mkForce true;
};
}

6 changes: 0 additions & 6 deletions nix/nixos-modules/astral/vfio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
"vfio_pci"
"vfio"
"vfio_iommu_type1"
#"vfio_virqfd"

#"nvidia"
#"nvidia_modeset"
#"nvidia_uvm"
#"nvidia_drm"
];
};
};
Expand Down

0 comments on commit db7b623

Please sign in to comment.