From 825f6ee783ff423c7f967b690d3ac2ed8aea1a1d Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Wed, 31 Jan 2024 20:24:33 +0800 Subject: [PATCH] nongnu: game-client: Preserve environment variables for NVIDIA driver. * nongnu/packages/nvidia.scm (%nvidia-environment-variable-regexps): New variable. * nongnu/packages/game-client.scm (steam-nvidia-container) (heroic-nvidia-container): Use it. Signed-off-by: John Kehayias --- nongnu/packages/game-client.scm | 6 ++++-- nongnu/packages/nvidia.scm | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/nongnu/packages/game-client.scm b/nongnu/packages/game-client.scm index 0cafb13..d9843ee 100644 --- a/nongnu/packages/game-client.scm +++ b/nongnu/packages/game-client.scm @@ -288,7 +288,8 @@ all games will be installed."))) (union32 (fhs-union steam-nvidia-container-libs #:name "fhs-union-32" - #:system "i686-linux")))) + #:system "i686-linux")) + (preserved-env %nvidia-environment-variable-regexps))) (define-public steam (nonguix-container->package steam-container)) (define-public steam-nvidia (nonguix-container->package steam-nvidia-container)) @@ -336,7 +337,8 @@ installed."))) (union32 (fhs-union steam-nvidia-container-libs #:name "fhs-union-32" - #:system "i686-linux")))) + #:system "i686-linux")) + (preserved-env %nvidia-environment-variable-regexps))) (define-public heroic (nonguix-container->package heroic-container)) (define-public heroic-nvidia (nonguix-container->package heroic-nvidia-container)) diff --git a/nongnu/packages/nvidia.scm b/nongnu/packages/nvidia.scm index 97039d9..f75d0d4 100644 --- a/nongnu/packages/nvidia.scm +++ b/nongnu/packages/nvidia.scm @@ -58,6 +58,21 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1)) +(define-public %nvidia-environment-variable-regexps + '("^__GL_" ; NVIDIA OpenGL settings. + "^__GLX_VENDOR_LIBRARY_NAME$" ; For GLVND. + ;; NVIDIA PRIME Render Offload. + "^__NV_PRIME_RENDER_OFFLOAD(_PROVIDER)?$" + "^__VK_LAYER_NV_optimus$" + ;; NVIDIA NGX. + "^__NGX_CONF_FILE$" + "^__NV_SIGNED_LOAD_CHECK$" + "^PROTON_ENABLE_NGX_UPDATER$" + ;; NVIDIA VDPAU settings. + "^VDPAU_NVIDIA_" + ;; GSYNC control for Vulkan direct-to-display applications. + "^VKDirectGSYNC(Compatible)?Allowed$")) + (define nvidia-version "515.76") (define computed-origin-method