From 216dd5b740f91f4250e33256e3c11e4e342895ce Mon Sep 17 00:00:00 2001 From: Cole Mickens Date: Thu, 16 Sep 2021 05:00:41 -0700 Subject: [PATCH] nvidia: fix egl-wayland loading --- nixos/modules/hardware/video/nvidia.nix | 4 ++++ pkgs/os-specific/linux/nvidia-x11/builder.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index 8f6b5c22ea4f..917c6d3013e7 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -284,6 +284,10 @@ in source = "${nvidia_x11.bin}/share/nvidia/nvidia-application-profiles-rc"; }; + # 'nvidia_x11' installs it's files to /run/opengl-driver/... + environment.etc."egl/egl_external_platform.d".source = + "/run/opengl-driver/share/egl/egl_external_platform.d/"; + hardware.opengl.package = mkIf (!offloadCfg.enable) nvidia_x11.out; hardware.opengl.package32 = mkIf (!offloadCfg.enable) nvidia_x11.lib32; hardware.opengl.extraPackages = optional offloadCfg.enable nvidia_x11.out; diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh index 51bd4d725a8b..abb557a55330 100755 --- a/pkgs/os-specific/linux/nvidia-x11/builder.sh +++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh @@ -106,8 +106,8 @@ installPhase() { sed -E "s#(libEGL_nvidia)#$i/lib/\\1#" 10_nvidia.json > 10_nvidia.json.fixed sed -E "s#(libnvidia-egl-wayland)#$i/lib/\\1#" 10_nvidia_wayland.json > 10_nvidia_wayland.json.fixed - install -Dm644 10_nvidia.json.fixed $i/share/glvnd/egl_vendor.d/nvidia.json - install -Dm644 10_nvidia_wayland.json.fixed $i/share/glvnd/egl_vendor.d/nvidia_wayland.json + install -Dm644 10_nvidia.json.fixed $i/share/glvnd/egl_vendor.d/10_nvidia.json + install -Dm644 10_nvidia_wayland.json.fixed $i/share/egl/egl_external_platform.d/10_nvidia_wayland.json fi done