summaryrefslogtreecommitdiff
path: root/tw/home.scm
diff options
context:
space:
mode:
authorTimo Wilken2023-10-08 15:26:07 +0200
committerTimo Wilken2023-10-08 15:43:51 +0200
commit13ca70f3f8178a1bb8ad11e141c010e200d4e5a1 (patch)
treeaa8f259043f254bc7f154741d701f7d73b8edebb /tw/home.scm
parentd750499c0c9627d12b0b67a9a896b39c14e1688e (diff)
Graft nvda onto picom if necessary
Picom fails on startup if using the proprietary nvidia driver but plain mesa libs.
Diffstat (limited to 'tw/home.scm')
-rw-r--r--tw/home.scm28
1 files changed, 19 insertions, 9 deletions
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.")