Merge pull request #318092 from aidalgol/libxnvctrl-pure

Use libXNVCtrl purely
This commit is contained in:
Kira Bruneau 2024-06-08 06:35:15 -04:00 committed by GitHub
commit 783a966a20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -285,7 +285,7 @@ in
KERNEL=="nvidia_uvm", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia-uvm-tools c $$(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 1'"
'';
hardware.opengl = {
extraPackages = [ nvidia_x11.out ] ++ (lib.optional (builtins.hasAttr "libXNVCtrl" nvidia_x11.settings) nvidia_x11.settings.libXNVCtrl);
extraPackages = [ nvidia_x11.out ];
extraPackages32 = [ nvidia_x11.lib32 ];
};
environment.systemPackages = [ nvidia_x11.bin ];

View File

@ -231,8 +231,9 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace $out/share/vulkan/implicit_layer.d/MangoHud.${layerPlatform}.json \
--replace "VK_LAYER_MANGOHUD_overlay" "VK_LAYER_MANGOHUD_overlay_${toString stdenv.hostPlatform.parsed.cpu.bits}"
'' + ''
# Add OpenGL driver path to RUNPATH to support NVIDIA cards
# Add OpenGL driver and libXNVCtrl paths to RUNPATH to support NVIDIA cards
addOpenGLRunpath "$out/lib/mangohud/libMangoHud.so"
patchelf --add-rpath ${libXNVCtrl}/lib "$out/lib/mangohud/libMangoHud.so"
'' + lib.optionalString gamescopeSupport ''
addOpenGLRunpath "$out/bin/mangoapp"
'' + lib.optionalString finalAttrs.finalPackage.doCheck ''