diff options
author | Timo Wilken | 2024-03-10 22:18:29 +0100 |
---|---|---|
committer | Timo Wilken | 2024-03-10 22:18:32 +0100 |
commit | 7b1bfaba0be41ed6316e7fdc432d10d1d5f3dcea (patch) | |
tree | c9337a1f37bb4b25e23a0c9517e2c708a067d610 | |
parent | 820cbff8e27ca05125a31a5f9203966b59fb8763 (diff) |
Track guix-gaming-channels configuration
-rw-r--r-- | tw/services/desktop.scm | 27 |
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." |