temp changes

This commit is contained in:
Ryan Schanzenbacher 2024-01-18 18:43:59 -05:00
parent c45e1fcd8b
commit c8a2ce5015
Signed by: ryan77627
GPG key ID: 81B0E222A3E2308E
2 changed files with 38 additions and 1 deletions

View file

@ -18,6 +18,7 @@
(gnu home services) (gnu home services)
(ryan-services pipewire) (ryan-services pipewire)
(ryan-services spotify) (ryan-services spotify)
(ryan-config utils)
(ryan-packages freedesktop) (ryan-packages freedesktop)
(ryan-packages mozilla)) (ryan-packages mozilla))
@ -132,7 +133,6 @@
("sway" ,(local-file "sway" #:recursive? #t)) ("sway" ,(local-file "sway" #:recursive? #t))
("hypr" ,(local-file "hypr" #:recursive? #t)) ("hypr" ,(local-file "hypr" #:recursive? #t))
("foot" ,(local-file "foot" #:recursive? #t)) ("foot" ,(local-file "foot" #:recursive? #t))
("spotify-player" ,(local-file "spotify-player" #:recursive? #t))
("pulse/client.conf" ,(local-file "pulseaudio/client.conf")) ("pulse/client.conf" ,(local-file "pulseaudio/client.conf"))
("waybar" ,(local-file "waybar" #:recursive? #t)) ("waybar" ,(local-file "waybar" #:recursive? #t))
("alacritty" ,(local-file "alacritty" #:recursive? #t)) ("alacritty" ,(local-file "alacritty" #:recursive? #t))
@ -149,6 +149,10 @@
(service home-pipewire-service-type) (service home-pipewire-service-type)
(service home-spotifyd-service-type) (service home-spotifyd-service-type)
(service home-dbus-service-type) (service home-dbus-service-type)
;;; trying some changes
(template-files "."
'("spotify-player/app.toml"
;;;
(service home-gpg-agent-service-type (service home-gpg-agent-service-type
(home-gpg-agent-configuration (home-gpg-agent-configuration
(pinentry-program (pinentry-program

View file

@ -0,0 +1,33 @@
(define-module (ryan-config utils)
#:use-module (gnu packages)
#:use-module (gnu services)
#:use-module (gnu home services)
#:use-module (gnu home services shepherd)
#:use-module (gnu packages freedesktop)
#:use-module (gnu services configuration)
#:use-module (guix gexp)
#:use-module (ice-9 regex)
#:use-module (ice-9 pretty-print)
#:use-module (ice-9 textual-ports)
#:export (gather-manifest-packages
apply-template-file))
(define (apply-template template-string value-alist)
(regexp-substitute/global #f
"\\$\\{([A-Za-z/\\-]+)\\}"
template-string
'pre
(lambda (m)
(let ((entry (assq (string->symbol (match:substring m 1))
value-alist)))
(if entry
(cdr entry)
"VALUE NOT FOUND")))
'post))
(define (apply-template-file file-path value-alist)
(call-with-input-file file-path
(lambda (port)
(apply-template (get-string-all port)
value-alist))))