~ruther/guix-config

e585ec4383a01489f61e65dccbb63e0e446b16bd — Rutherther a month ago 1c98c28
feat: allow usage of Nixpkgs OpenGL programs
2 files changed, 32 insertions(+), 1 deletions(-)

M config.scm
A modules/ruther/services/nix-gl.scm
M config.scm => config.scm +5 -1
@@ 22,6 22,7 @@
 (gnu system accounts)
 (ruther services system)
 (ruther services bind)
 (ruther services nix-gl)
 (ruther bootloader grub))
(use-service-modules desktop sddm xorg base nix pm virtualization vpn
                     sound dbus cups containers security-token networking


@@ 31,7 32,7 @@
                     linux embedded finance python-xyz freedesktop
                     python-build haskell-apps commencement
                     polkit firmware databases guile security-token
                     docker)
                     docker base)

(define wireshark-patched
  (package/inherit wireshark


@@ 277,6 278,9 @@
                           (home "/home/fbw"))
                          %default-guix-shared-users))))


              ;; Let's use GUI apps from Nixpkgs, because, why not?
              nixos-opengl-driver-service
              (service nix-service-type
                       (nix-configuration
                        (extra-config

A modules/ruther/services/nix-gl.scm => modules/ruther/services/nix-gl.scm +27 -0
@@ 0,0 1,27 @@
(define-module (ruther services nix-gl)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix utils)

  #:use-module (gnu packages gl)

  #:use-module (gnu services)
  #:use-module (gnu services sysctl)
  #:use-module (gnu services configuration))

(define-public mesa-w-libglvnd
  (package/inherit mesa
    (inputs (modify-inputs (package-inputs mesa)
              (append libglvnd)))
    (arguments
      (substitute-keyword-arguments (package-arguments mesa)
        ((#:phases phases #~%standard-phases)
         #~(modify-phases #$phases
             (add-after 'install 'patch-glvnd-json
               (lambda _
                 (substitute* (string-append #$output "/share/glvnd/egl_vendor.d/50_mesa.json")
                   (("libEGL_mesa\\.so\\.0")
                    (string-append #$output "/lib/libEGL_mesa.so.0")))))))))))

(define-public nixos-opengl-driver-service
  (extra-special-file "/run/opengl-driver" mesa-w-libglvnd))