Add mpdscrobble service
This commit is contained in:
parent
dbfce1861c
commit
53cc05214f
3 changed files with 79 additions and 4 deletions
|
@ -109,7 +109,8 @@
|
||||||
home-mpd-configuration
|
home-mpd-configuration
|
||||||
<home-mpd-audio-output>
|
<home-mpd-audio-output>
|
||||||
home-mpc-update-service-type
|
home-mpc-update-service-type
|
||||||
home-mpd-notify-service-type))
|
home-mpd-notify-service-type
|
||||||
|
home-mpdscrobble-service-type))
|
||||||
#:use-module ((oni home services mpv)
|
#:use-module ((oni home services mpv)
|
||||||
#:select (home-mpv-service-type
|
#:select (home-mpv-service-type
|
||||||
home-mpv-mpris-service-type))
|
home-mpv-mpris-service-type))
|
||||||
|
@ -466,6 +467,7 @@
|
||||||
#:format "44100:16:2")))))
|
#:format "44100:16:2")))))
|
||||||
(service home-mpc-update-service-type)
|
(service home-mpc-update-service-type)
|
||||||
(service home-mpd-notify-service-type)
|
(service home-mpd-notify-service-type)
|
||||||
|
(service home-mpdscrobble-service-type)
|
||||||
|
|
||||||
(service home-mpv-service-type)
|
(service home-mpv-service-type)
|
||||||
;; [2024-01-05 Fri] mpv-mpris fails to compile:
|
;; [2024-01-05 Fri] mpv-mpris fails to compile:
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
#:use-module (oop goops)
|
#:use-module (oop goops)
|
||||||
#:use-module (ice-9 string-fun)
|
#:use-module (ice-9 string-fun)
|
||||||
#:use-module ((oni packages mpd)
|
#:use-module ((oni packages mpd)
|
||||||
#:select (mpd-notify))
|
#:select (mpd-notify
|
||||||
|
mpdscrobble))
|
||||||
|
|
||||||
#:export (home-mpd-service-type
|
#:export (home-mpd-service-type
|
||||||
home-mpd-configuration
|
home-mpd-configuration
|
||||||
|
@ -20,7 +21,10 @@
|
||||||
home-mpc-update-configuration
|
home-mpc-update-configuration
|
||||||
|
|
||||||
home-mpd-notify-service-type
|
home-mpd-notify-service-type
|
||||||
home-mpd-notify-configuration))
|
home-mpd-notify-configuration
|
||||||
|
|
||||||
|
home-mpdscrobble-service-type
|
||||||
|
home-mpdscrobble-configuration))
|
||||||
|
|
||||||
(define (serialize-boolean field value)
|
(define (serialize-boolean field value)
|
||||||
"")
|
"")
|
||||||
|
@ -204,3 +208,44 @@
|
||||||
(compose identity)
|
(compose identity)
|
||||||
(default-value (home-mpd-notify-configuration))
|
(default-value (home-mpd-notify-configuration))
|
||||||
(description "Install and configure mpd notifications.")))
|
(description "Install and configure mpd notifications.")))
|
||||||
|
|
||||||
|
(define-configuration home-mpdscrobble-configuration
|
||||||
|
(package
|
||||||
|
(package mpdscrobble)
|
||||||
|
"Pakcage to use for setting mpdscrobble")
|
||||||
|
(auto-start?
|
||||||
|
(boolean #t)
|
||||||
|
"Should mpdscrobble be started automatically?"))
|
||||||
|
|
||||||
|
(define (add-mpdscrobble-packages config)
|
||||||
|
(list (home-mpdscrobble-configuration-package config)))
|
||||||
|
|
||||||
|
(define (home-mpdscrobble-shepherd-service config)
|
||||||
|
(list
|
||||||
|
(shepherd-service
|
||||||
|
(documentation "Scrobble songs to last.fm and/or maloja")
|
||||||
|
(provision '(mpdscrobble))
|
||||||
|
(requirement '(mpd))
|
||||||
|
(auto-start? (home-mpdscrobble-configuration-auto-start? config))
|
||||||
|
(start
|
||||||
|
#~(make-forkexec-constructor
|
||||||
|
(list #$(file-append (home-mpdscrobble-configuration-package config) "/bin/mpdscrobble"))
|
||||||
|
#:log-file (format #f "~a/.local/var/log/mpdscrobble.log" (getenv "HOME"))))
|
||||||
|
(stop #~(make-kill-destructor))
|
||||||
|
(respawn? #t)
|
||||||
|
(respawn-delay 1)
|
||||||
|
(respawn-limit 60))))
|
||||||
|
|
||||||
|
(define home-mpdscrobble-service-type
|
||||||
|
(service-type
|
||||||
|
(name 'home-mpdscrobble)
|
||||||
|
(extensions
|
||||||
|
(list (service-extension
|
||||||
|
home-profile-service-type
|
||||||
|
add-mpdscrobble-packages)
|
||||||
|
(service-extension
|
||||||
|
home-shepherd-service-type
|
||||||
|
home-mpdscrobble-shepherd-service)))
|
||||||
|
(compose identity)
|
||||||
|
(default-value (home-mpdscrobble-configuration))
|
||||||
|
(description "Install and configure mpdscrobble.")))
|
||||||
|
|
|
@ -6,8 +6,14 @@
|
||||||
#:use-module (gnu packages mpd)
|
#:use-module (gnu packages mpd)
|
||||||
#:use-module (gnu packages gnome)
|
#:use-module (gnu packages gnome)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
|
#:use-module (guix build-system python)
|
||||||
|
#:use-module (guix build-system pyproject)
|
||||||
|
#:use-module (guix download)
|
||||||
#:use-module (guix git-download)
|
#:use-module (guix git-download)
|
||||||
#:use-module (guix packages))
|
#:use-module (guix packages)
|
||||||
|
#:use-module (gnu packages python-web)
|
||||||
|
#:use-module (gnu packages music)
|
||||||
|
#:use-module (gnu packages check))
|
||||||
|
|
||||||
(define-public mpd-notify
|
(define-public mpd-notify
|
||||||
(let ((commit "1bf3786878eb499b6a0c56e47ba3f3e07cd81182")
|
(let ((commit "1bf3786878eb499b6a0c56e47ba3f3e07cd81182")
|
||||||
|
@ -76,3 +82,25 @@
|
||||||
(synopsis "A simple script that populates the MPD playlist with all of my albums in random order.")
|
(synopsis "A simple script that populates the MPD playlist with all of my albums in random order.")
|
||||||
(description "Creates a new playlist in MPD with all of the albums in my database and shuffles them by album.")
|
(description "Creates a new playlist in MPD with all of the albums in my database and shuffles them by album.")
|
||||||
(license license:gpl3+))))
|
(license license:gpl3+))))
|
||||||
|
|
||||||
|
(define-public mpdscrobble
|
||||||
|
(let ((commit "c4314b026183a2b38673db898deb98f24dfb3901")
|
||||||
|
(revision "0"))
|
||||||
|
(package
|
||||||
|
(name "python-mpdscrobble")
|
||||||
|
(version (git-version "0.3.3" revision commit))
|
||||||
|
(source
|
||||||
|
(origin
|
||||||
|
(method git-fetch)
|
||||||
|
(uri (git-reference
|
||||||
|
(url "https://github.com/dbeley/mpdscrobble")
|
||||||
|
(commit commit)))
|
||||||
|
(sha256
|
||||||
|
(base32 "1kixss0s182hhl52qrr646zswx0c81si6jxz08jc8sal8y1rm4ql"))))
|
||||||
|
(build-system pyproject-build-system)
|
||||||
|
(native-inputs (list python-pytest))
|
||||||
|
(propagated-inputs (list python-httpx python-pylast python-mpd2))
|
||||||
|
(home-page "https://github.com/dbeley/mpdscrobble")
|
||||||
|
(synopsis "A simple Last.fm scrobbler for MPD.")
|
||||||
|
(description "This package provides a simple Last.fm scrobbler for MPD.")
|
||||||
|
(license license:expat))))
|
||||||
|
|
Loading…
Reference in a new issue