From 13ca70f3f8178a1bb8ad11e141c010e200d4e5a1 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sun, 8 Oct 2023 15:26:07 +0200 Subject: Graft nvda onto picom if necessary Picom fails on startup if using the proprietary nvidia driver but plain mesa libs. --- tw/home.scm | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'tw/home.scm') diff --git a/tw/home.scm b/tw/home.scm index a933801b..4764bcf2 100644 --- a/tw/home.scm +++ b/tw/home.scm @@ -8,8 +8,10 @@ #:use-module (gnu home services shepherd) #:use-module (gnu home services ssh) #:use-module (guix gexp) + #:use-module (guix packages) ;; Don't load nongnu on hosts where it's not available, i.e. servers. #:autoload (nongnu packages messaging) (zoom) + #:autoload (nongnu packages nvidia) (nvda) #:use-module (tw gexp) #:use-module (tw packages alice) #:use-module (tw packages catppuccin) @@ -22,7 +24,7 @@ (use-package-modules admin aidc backup base calendar check chromium compression cmake compton curl databases dav disk dns dunst elf emacs emacs-xyz file finance fonts - freedesktop games gcc gimp gnome gnome-xyz gnupg gnuzilla graphviz + freedesktop games gcc gimp gl gnome gnome-xyz gnupg gnuzilla graphviz haskell-apps image-viewers imagemagick inkscape less libreoffice linux lisp llvm mail maths ncdu package-management password-utils pdf pretty-print pulseaudio pv python python-build python-check python-xyz rsync shells @@ -367,7 +369,8 @@ show_mouse=0 show_border=1 ")) -(define-public %interactive-services +(export interactive-services) +(define* (interactive-services #:key (nvidia-driver? #f)) (list ;; Configuration files for terminal-only programs in $XDG_CONFIG_HOME. (simple-service 'interactive-terminal-config home-xdg-configuration-files-service-type @@ -418,13 +421,20 @@ show_border=1 (list #$(file-append dunst "/bin/dunst")))) (stop #~(make-kill-destructor))) - (shepherd-service - (documentation "Picom compositor; enables transparent windows in X.") - (provision '(picom)) - (start #~(make-forkexec-constructor - (list #$(file-append picom "/bin/picom") - "--config" #$(local-file "home/files/picom.conf")))) - (stop #~(make-kill-destructor))) + ;; Picom needs to use the proprietary nvidia driver's libgl if that + ;; driver is used for Xorg; plain Mesa won't work then. + (let ((grafter + (if nvidia-driver? + (package-input-rewriting + `((,mesa . ,(package (inherit mesa) (replacement nvda))))) + identity))) + (shepherd-service + (documentation "Picom compositor; enables transparent windows in X.") + (provision '(picom)) + (start #~(make-forkexec-constructor + (list #$(file-append (grafter picom) "/bin/picom") + "--config" #$(local-file "home/files/picom.conf")))) + (stop #~(make-kill-destructor)))) (shepherd-service (documentation "Source Xresources on login.") -- cgit v1.2.3