mirror of
https://git.in.rschanz.org/ryan77627/guix-config.git
synced 2024-11-07 11:36:14 -05:00
43 lines
1.9 KiB
Scheme
43 lines
1.9 KiB
Scheme
(define-module (ryan-services spotify)
|
|
#:use-module (gnu packages)
|
|
#:use-module (gnu packages rust-apps)
|
|
#:use-module (gnu services)
|
|
#:use-module (gnu services configuration)
|
|
#:use-module (gnu home services)
|
|
#:use-module (gnu home services shepherd)
|
|
#:use-module (guix gexp))
|
|
|
|
(define (home-spotifyd-profile-service config)
|
|
(map specification->package
|
|
(list "spotifyd")))
|
|
|
|
(define (home-spotifyd-shepherd-service config)
|
|
;; spotifyd daemon
|
|
(list (shepherd-service
|
|
(requirement '(pipewire))
|
|
(provision '(spotifyd))
|
|
(stop #~(make-kill-destructor))
|
|
(start #~(make-forkexec-constructor
|
|
(list #$(file-append spotifyd "/bin/spotifyd")
|
|
"--volume-normalisation"
|
|
"-B320"
|
|
(format #f "--device-name=~a" (gethostname))
|
|
"--device-type=computer"
|
|
"--no-daemon")
|
|
#:log-file (string-append
|
|
(or (getenv "XDG_LOG_HOME")
|
|
(format #f "~a/.local/var/log"
|
|
(getenv "HOME")))
|
|
"/spotifyd.log"))))))
|
|
|
|
(define-public home-spotifyd-service-type
|
|
(service-type (name 'home-spotifyd)
|
|
(extensions
|
|
(list (service-extension
|
|
home-profile-service-type
|
|
home-spotifyd-profile-service)
|
|
(service-extension
|
|
home-shepherd-service-type
|
|
home-spotifyd-shepherd-service)))
|
|
(default-value #f)
|
|
(description "Provides spotifyd daemon in the background")))
|