aboutsummaryrefslogtreecommitdiff
path: root/tw/services
diff options
context:
space:
mode:
Diffstat (limited to 'tw/services')
-rw-r--r--tw/services/desktop.scm27
1 files changed, 26 insertions, 1 deletions
diff --git a/tw/services/desktop.scm b/tw/services/desktop.scm
index 14739b2b..5b0bf7a4 100644
--- a/tw/services/desktop.scm
+++ b/tw/services/desktop.scm
@@ -237,7 +237,32 @@ show_border=1
("rofi/themes/catppuccin.rasi" ,catppuccin-rofi)
("xfce4/xfce4-screenshooter" ,xfce4-screenshooter.conf)
("zathura/zathurarc" ,(local-file "files/zathurarc"))
- ("zathura/catppuccin" ,catppuccin-zathura)))
+ ("zathura/catppuccin" ,catppuccin-zathura)
+
+ ,@(match-record config <home-desktop-configuration> (gaming?)
+ (if gaming?
+ `(("guix-gaming-channels/games.scm"
+ ,(scheme-file "guix-gaming-credentials.scm"
+ #~(begin
+ (use-modules (ice-9 rdelim) (ice-9 popen))
+ (define gog-credentials
+ (let* ((pass (open-pipe* OPEN_READ "pass" "show" "software/games/gog"))
+ (password (read-line pass))
+ (username
+ (let loop ((line (read-line pass)))
+ (cond
+ ((eof-object? line)
+ (error "Could not find username in pass output"))
+ ((string-prefix? "username: " line)
+ (string-trim
+ (substring line (string-length "username:"))))
+ (else (loop (read-line pass)))))))
+ (close-pipe pass)
+ `((email ,username)
+ (password ,password))))
+ (make-gaming-config
+ `((gog ,gog-credentials)))))))
+ '()))))
(define (home-files config)
"Extra configuration files and binaries that don't follow the XDG spec."