From 7b1bfaba0be41ed6316e7fdc432d10d1d5f3dcea Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sun, 10 Mar 2024 22:18:29 +0100 Subject: Track guix-gaming-channels configuration --- tw/services/desktop.scm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'tw/services') 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 (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." -- cgit v1.2.3