vfio/lookingGlass: more robust way of applying overlay

This commit is contained in:
chayleaf 2023-07-12 14:59:52 +07:00
parent d2377ffb5d
commit ab6e49cab5
2 changed files with 5 additions and 2 deletions

View file

@ -35,7 +35,7 @@ in
fetchSubmodules = true;
};
});
kvmfrOverlay = pkgs.linuxPackages_latest.kvmfr.overrideAttrs (old: {
kvmfrOverlay = kvmfr: kvmfr.overrideAttrs (old: {
inherit (pkgs'.looking-glass-client) version src;
patches = [ ./kvmfr-linux6_4.patch ];
});

View file

@ -130,8 +130,11 @@ in {
"vfio_iommu_type1"
"vfio_pci"
];
# kvmfrOverlay is defined in pkgs/default.nix
# I use it to keep looking-glass and kvmfr's version pinned
# (and in this case also to keep linux 6.4 compatibility)
extraModulePackages =
lib.mkIf enableIvshmem [ (pkgs.kvmfrOverlay or config.boot.kernelPackages.kvmfr) ];
lib.mkIf enableIvshmem [ ((pkgs.kvmfrOverlay or lib.id) config.boot.kernelPackages.kvmfr) ];
extraModprobeConfig = ''
options vfio-pci ids=${builtins.concatStringsSep "," cfg.pciIDs} disable_idle_d3=1
options kvm ignore_msrs=1