Compare commits

...

8 Commits

Author SHA1 Message Date
John Kehayias
6da06a35b5
[WIP] nongnu: multiarch-container: Allow extra shared directories.
* nonguix/multiarch-container.scm (make-container-wrapper): Use environment
variable $GUIX_SANDBOX_EXTRA_SHARES to pass extra directories to share with
the container.
2023-10-22 15:54:54 -04:00
John Kehayias
6ac2849b56
[DRAFT] nongnu: steam: Use mesa-next.
* nongnu/packages/steam-client.scm (steam-client-libs): Replace mesa-fixed
with mesa-next.
2023-10-22 15:52:08 -04:00
John Kehayias
46c8b08cd6
[DRAFT] nongnu: Add mesa-git.
* nongnu/packages/steam-client.scm (mesa-git): New variable.
2023-10-22 15:51:01 -04:00
John Kehayias
3da4fa5d28
[DRAFT] nongnu: Add mesa-next.
* nongnu/packages/steam-client.scm (mesa-next): New variable.
(mesa-fixed): Remove variable.
2023-10-22 15:49:16 -04:00
John Kehayias
bc0921a7bc
nonguix: multiarch-container: Make locale usable by pressure-vessel.
Steam's pressure-vessel startup time can be improved by not having to generate
locales.  So make sure locales are in and used by the pressure-vessel
container by linking the expected location of /usr/lib/locale (presumably so
that pressure-vessel will capture them) and setting $GUIX_LOCPATH.

* nonguix/multiarch-container.scm (make-container-wrapper): Preserve and set
GUIX_LOCPATH.
(make-internal-script): Add symlink for /usr/lib/locale.
2023-10-22 15:20:52 -04:00
John Kehayias
18db7ec1af
nonguix: multiarch-container: Preserve MANGOHUD.
Now one can have set MANGOHUD=1 in their environment to have all Steam games
launch with MangoHud, rather than always setting this per game launch
settings.  Likewise for MANGOHUD_CONFIG for configuration.

* nonguix/multiarch-container.scm (make-container-wrapper): Preserve MANGOHUD
environment variables.
2023-10-22 15:20:51 -04:00
John Kehayias
9e99a4dc6f
nonguix: multiarch-container: Set LD_LIBRARY_PATH (for steam).
Setting $LD_LIBRARY_PATH in the container allows for non-Steam games added to
Steam to launch properly with Proton.  Otherwise they don't make it to the
pressure-vessel container as it seems they start in an environment where the
rest of our setup is not active (e.g. game will fail to launch with an error
about being unable to load libGL.so.1).

* nonguix/multiarch-container.scm (make-container-wrapper): Preserve
LD_LIBRARY_PATH and set it.
2023-10-22 15:20:49 -04:00
John Kehayias
2ae2326435
nonguix: multiarch-container: Remove pressure-vessel workaround.
Setting $PRESSURE_VESSEL_FILESYSTEMS_RO to "/gnu/store" is no longer needed
for Steam as the fix has been merged upstream.  Users can still set this
environment variable (preserved in the container) if needed.

* nonguix/multiarch-container.scm (make-container-wrapper): Remove setting
$PRESSURE_VESSEL_FILESYSTEMS_RO.
2023-10-22 15:20:46 -04:00
2 changed files with 64 additions and 11 deletions

View File

@ -120,13 +120,42 @@
(modify-inputs (package-propagated-inputs libxdamage)
(replace "libx11" libx11-fixed)))))
(define mesa-fixed
(define-public mesa-next
(package
(inherit mesa)
(propagated-inputs
(modify-inputs (package-propagated-inputs mesa)
(replace "libx11" libx11-fixed)
(replace "libxdamage" libxdamage-fixed)))))
(replace "libxdamage" libxdamage-fixed)))
(name "mesa-next")
(version "23.2.1")
(source
(origin
(method url-fetch)
(uri (list (string-append "https://archive.mesa3d.org/"
"mesa-" version ".tar.xz")
(string-append "ftp://ftp.freedesktop.org/pub/mesa/"
"mesa-" version ".tar.xz")))
(sha256
(base32
"1k61pgw0vcjrlb4299q98cy7iqmk2r7jmb5ika91z01dzhb0dpk4"))))))
(define-public mesa-git
(let ((commit "9f4f52f4f3466ba4570f163c869fc1c04b21e5c9")
(revision "0"))
(package
(inherit mesa-next)
(name "mesa-git")
(version (git-version "23.3.0-devel" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.freedesktop.org/mesa/mesa")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32 "17s2kyf0dsmvi7cnvrmsy39db6j9sba94y34345kqmg4rc2z150a")))))))
(define steam-client-libs
`(("bash" ,bash) ; Required for steam startup.
@ -151,9 +180,7 @@
("libvdpau-va-gl" ,libvdpau-va-gl) ; Additional VDPAU support.
("llvm" ,llvm-for-mesa) ; Required for mesa.
("lsof" ,lsof) ; Required for some friend's list actions.
;; TODO: Set back to mesa once libx11 is ungrafted upstream or once
;; <https://issues.guix.gnu.org/53406> is fixed.
("mesa" ,mesa-fixed) ; Required for steam startup.
("mesa" ,mesa-next) ; Required for steam startup.
("nss-certs" ,nss-certs) ; Required for steam login.
("pciutils" ,pciutils) ; Tries to run lspci at steam startup.
("procps" ,procps)

View File

@ -260,6 +260,19 @@ in a sandboxed FHS environment."
"^DISPLAY$"
"^DRI_PRIME$"
"^GDK_SCALE$" ; For UI scaling.
"^GUIX_LOCPATH$" ; For pressure-vessel locales.
;; For startup of added non-Steam games as it
;; seems they start in an early environment
;; before our additional settings. (Likely
;; this can be removed when rewritten to use
;; --emulate-fhs from upstream.) Note that
;; this is explicitly set below. We could
;; preserve what is set before launching the
;; container, but any such directories would
;; need to be shared with the container as
;; well; this is not needed currently.
"^LD_LIBRARY_PATH$"
"^MANGOHUD" ; For MangoHud configuration.
"^PRESSURE_VESSEL_" ; For pressure vessel options.
"_PROXY$"
"_proxy$"
@ -317,14 +330,21 @@ in a sandboxed FHS environment."
,@(exists-> (getenv "XAUTHORITY"))
#$@(ngc-shared container)))
(DEBUG (equal? (getenv "DEBUG") "1"))
(extra-shares (if (getenv "GUIX_SANDBOX_EXTRA_SHARES")
(string-split (getenv "GUIX_SANDBOX_EXTRA_SHARES") #\:)
#f))
(args (cdr (command-line)))
(command (if DEBUG '()
`("--" ,run ,@args))))
;; TODO: Remove once upstream change is merged and in stable pressure-vessel
;; (although may want to hold off for anyone using older pressure-vessel versions
;; for whatever reason), see:
;; https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/merge_requests/406
(setenv "PRESSURE_VESSEL_FILESYSTEMS_RO" "/gnu/store")
;; Set this so that e.g. non-Steam games added to Steam will launch
;; properly. It seems otherwise they don't make it to launching
;; Steam's pressure-vessel container (for Proton games).
(setenv "LD_LIBRARY_PATH" "/lib64:/lib")
;; Set this so Steam's pressure-vessel container does not need to
;; generate locales, improving startup time. This needs to be set to
;; the "usual" path, probably so they are included in the
;; pressure-vessel container.
(setenv "GUIX_LOCPATH" "/usr/lib/locale")
;; By default VDPAU drivers are searched for in libvdpau's store
;; path, so set this path to where the drivers will actually be
;; located in the container.
@ -345,7 +365,9 @@ in a sandboxed FHS environment."
,@(map add-path expose)
,@(map (lambda (item)
(add-path item #:writable? #t))
share)
(if extra-shares
(append share extra-shares)
share))
"-m" ,manifest-file
,@command))))))
@ -463,6 +485,7 @@ application."
'("/run/current-system/profile/etc"
"/run/current-system/profile/share"
"/sbin"
"/usr/lib"
"/usr/share/vulkan/icd.d"))
(for-each
new-symlink
@ -480,6 +503,9 @@ application."
((,union64 "lib") . "/lib64")
((,union64 "lib") . "/run/current-system/profile/lib64")
((,union64 "lib/locale") . "/run/current-system/locale")
;; Despite using GUIX_LOCPATH, stil need locales in their
;; expected location for pressure-vessel to use them.
((,union64 "lib/locale") . "/usr/lib/locale")
((,union64 "sbin/ldconfig") . "/sbin/ldconfig")
((,union64 "share/mime") . "/usr/share/mime") ; Steam tray icon.
((,union64 "share/drirc.d") . "/usr/share/drirc.d")