diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-01-13 23:55:15 -0500 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-01-13 23:55:15 -0500 |
| commit | 12e3af575860ca4cdbcef6fd2267ebd6befe0f49 (patch) | |
| tree | 22516cc9e4e488e24c50384c504bc7ef59340bf6 /modules | |
| parent | 67bd380ad4a43ee9ed084b701ed2c685564a7fa2 (diff) | |
Added spotify-player and spotifyd service
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/ryan-services/spotify.scm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/ryan-services/spotify.scm b/modules/ryan-services/spotify.scm new file mode 100644 index 0000000..1ddb9cf --- /dev/null +++ b/modules/ryan-services/spotify.scm | |||
| @@ -0,0 +1,43 @@ | |||
| 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"))) | ||
