modules/ryan-services/spotify.scm
c23b60f866a687aa6ae3618265f47ae63c9c5b64
· 1.9 KB · 43 lines
raw
| 1 | (define-module (ryan-services spotify) |
| 2 | #:use-module (gnu packages) |
| 3 | #:use-module (gnu packages rust-apps) |
| 4 | #:use-module (gnu services) |
| 5 | #:use-module (gnu services configuration) |
| 6 | #:use-module (gnu home services) |
| 7 | #:use-module (gnu home services shepherd) |
| 8 | #:use-module (guix gexp)) |
| 9 | |
| 10 | (define (home-spotifyd-profile-service config) |
| 11 | (map specification->package |
| 12 | (list "spotifyd"))) |
| 13 | |
| 14 | (define (home-spotifyd-shepherd-service config) |
| 15 | ;; spotifyd daemon |
| 16 | (list (shepherd-service |
| 17 | (requirement '(pipewire)) |
| 18 | (provision '(spotifyd)) |
| 19 | (stop #~(make-kill-destructor)) |
| 20 | (start #~(make-forkexec-constructor |
| 21 | (list #$(file-append spotifyd "/bin/spotifyd") |
| 22 | "--volume-normalisation" |
| 23 | "-B320" |
| 24 | (format #f "--device-name=~a" (gethostname)) |
| 25 | "--device-type=computer" |
| 26 | "--no-daemon") |
| 27 | #:log-file (string-append |
| 28 | (or (getenv "XDG_LOG_HOME") |
| 29 | (format #f "~a/.local/var/log" |
| 30 | (getenv "HOME"))) |
| 31 | "/spotifyd.log")))))) |
| 32 | |
| 33 | (define-public home-spotifyd-service-type |
| 34 | (service-type (name 'home-spotifyd) |
| 35 | (extensions |
| 36 | (list (service-extension |
| 37 | home-profile-service-type |
| 38 | home-spotifyd-profile-service) |
| 39 | (service-extension |
| 40 | home-shepherd-service-type |
| 41 | home-spotifyd-shepherd-service))) |
| 42 | (default-value #f) |
| 43 | (description "Provides spotifyd daemon in the background"))) |