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 | |
| parent | 67bd380ad4a43ee9ed084b701ed2c685564a7fa2 (diff) | |
Added spotify-player and spotifyd service
| -rw-r--r-- | home-config/home-configuration.scm | 3 | ||||
| -rw-r--r-- | home-config/nix-home-manager/home.nix | 1 | ||||
| -rw-r--r-- | home-config/spotify-player/app.toml | 34 | ||||
| -rw-r--r-- | modules/ryan-services/spotify.scm | 43 |
4 files changed, 81 insertions, 0 deletions
diff --git a/home-config/home-configuration.scm b/home-config/home-configuration.scm index 5c4eb8b..3651d6c 100644 --- a/home-config/home-configuration.scm +++ b/home-config/home-configuration.scm | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | (gnu home services gnupg) | 17 | (gnu home services gnupg) |
| 18 | (gnu home services) | 18 | (gnu home services) |
| 19 | (ryan-services pipewire) | 19 | (ryan-services pipewire) |
| 20 | (ryan-services spotify) | ||
| 20 | (ryan-packages freedesktop) | 21 | (ryan-packages freedesktop) |
| 21 | (ryan-packages mozilla)) | 22 | (ryan-packages mozilla)) |
| 22 | 23 | ||
| @@ -128,6 +129,7 @@ | |||
| 128 | ("sway" ,(local-file "sway" #:recursive? #t)) | 129 | ("sway" ,(local-file "sway" #:recursive? #t)) |
| 129 | ("hypr" ,(local-file "hypr" #:recursive? #t)) | 130 | ("hypr" ,(local-file "hypr" #:recursive? #t)) |
| 130 | ("foot" ,(local-file "foot" #:recursive? #t)) | 131 | ("foot" ,(local-file "foot" #:recursive? #t)) |
| 132 | ("spotify-player" ,(local-file "spotify-player" #:recursive? #t)) | ||
| 131 | ("pulse/client.conf" ,(local-file "pulseaudio/client.conf")) | 133 | ("pulse/client.conf" ,(local-file "pulseaudio/client.conf")) |
| 132 | ("waybar" ,(local-file "waybar" #:recursive? #t)) | 134 | ("waybar" ,(local-file "waybar" #:recursive? #t)) |
| 133 | ("alacritty" ,(local-file "alacritty" #:recursive? #t)) | 135 | ("alacritty" ,(local-file "alacritty" #:recursive? #t)) |
| @@ -142,6 +144,7 @@ | |||
| 142 | (".docker/cli-plugins" ,(local-file "docker/cli-plugins" #:recursive? #t)) | 144 | (".docker/cli-plugins" ,(local-file "docker/cli-plugins" #:recursive? #t)) |
| 143 | (".nix-channels" ,(local-file "nix-channels")))) | 145 | (".nix-channels" ,(local-file "nix-channels")))) |
| 144 | (service home-pipewire-service-type) | 146 | (service home-pipewire-service-type) |
| 147 | (service home-spotifyd-service-type) | ||
| 145 | (service home-dbus-service-type) | 148 | (service home-dbus-service-type) |
| 146 | (service home-gpg-agent-service-type | 149 | (service home-gpg-agent-service-type |
| 147 | (home-gpg-agent-configuration | 150 | (home-gpg-agent-configuration |
diff --git a/home-config/nix-home-manager/home.nix b/home-config/nix-home-manager/home.nix index e1ec08a..5c0ee46 100644 --- a/home-config/nix-home-manager/home.nix +++ b/home-config/nix-home-manager/home.nix | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | gifski | 40 | gifski |
| 41 | waypaper | 41 | waypaper |
| 42 | gdu | 42 | gdu |
| 43 | spotify-player | ||
| 43 | 44 | ||
| 44 | # # It is sometimes useful to fine-tune packages, for example, by applying | 45 | # # It is sometimes useful to fine-tune packages, for example, by applying |
| 45 | # # overrides. You can do that directly here, just don't forget the | 46 | # # overrides. You can do that directly here, just don't forget the |
diff --git a/home-config/spotify-player/app.toml b/home-config/spotify-player/app.toml new file mode 100644 index 0000000..4eac5e4 --- /dev/null +++ b/home-config/spotify-player/app.toml | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | theme = "dracula" | ||
| 2 | client_id = "4b1219bdc29945bc8ca914f80a8a6a47" | ||
| 3 | client_port = 8888 | ||
| 4 | playback_format = """ | ||
| 5 | {track} • {artists} | ||
| 6 | {album} | ||
| 7 | {metadata}""" | ||
| 8 | tracks_playback_limit = 50 | ||
| 9 | app_refresh_duration_in_ms = 32 | ||
| 10 | playback_refresh_duration_in_ms = 0 | ||
| 11 | cover_image_refresh_duration_in_ms = 2000 | ||
| 12 | page_size_in_rows = 20 | ||
| 13 | play_icon = "▶" | ||
| 14 | pause_icon = "▌▌" | ||
| 15 | liked_icon = "♥" | ||
| 16 | border_type = "Plain" | ||
| 17 | progress_bar_type = "Rectangle" | ||
| 18 | playback_window_position = "Top" | ||
| 19 | cover_img_length = 9 | ||
| 20 | cover_img_width = 5 | ||
| 21 | cover_img_scale = 1.0 | ||
| 22 | playback_window_width = 6 | ||
| 23 | enable_media_control = true | ||
| 24 | enable_streaming = "DaemonOnly" | ||
| 25 | enable_cover_image_cache = true | ||
| 26 | default_device = "RyanThinkpad" | ||
| 27 | |||
| 28 | [copy_command] | ||
| 29 | command = "wlcopy" | ||
| 30 | args = [] | ||
| 31 | |||
| 32 | [notify_format] | ||
| 33 | summary = "{track} • {artists}" | ||
| 34 | body = "{album}" | ||
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"))) | ||
