From 1bf58e4ef1c7e026ca1c464c0327c3ab44a292b6 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 15 Sep 2024 11:51:40 +0200 Subject: [PATCH] feat: add mpris-ctld service --- home/home-configuration.scm | 2 ++ .../ruther/home/services/mpris-ctld.scm | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 home/modules/ruther/home/services/mpris-ctld.scm diff --git a/home/home-configuration.scm b/home/home-configuration.scm index 440f43e..a8885c6 100644 --- a/home/home-configuration.scm +++ b/home/home-configuration.scm @@ -28,6 +28,7 @@ (ruther home dwl scripts) (ruther home packages themes) (ruther home services hydroxide) + (ruther home services mpris-ctld) (ruther home services gtk) (ruther home services xdg-desktop-portals) (ruther home services wayland) @@ -267,6 +268,7 @@ exec ~a ~a" (home-emacs-configuration (emacs emacs-pgtk))) (service hydroxide-service-type) + (service mpris-ctld-service-type) (service home-blueman-applet-service-type) (service home-network-manager-applet-service-type) (service home-gammastep-service-type) diff --git a/home/modules/ruther/home/services/mpris-ctld.scm b/home/modules/ruther/home/services/mpris-ctld.scm new file mode 100644 index 0000000..e8b8b56 --- /dev/null +++ b/home/modules/ruther/home/services/mpris-ctld.scm @@ -0,0 +1,33 @@ +(define-module (ruther home services mpris-ctld) + #:use-module (guix gexp) + #:use-module (ruther packages ruther) + #:use-module (gnu packages mail) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu services shepherd) + #:use-module (gnu services configuration) + #:use-module (gnu services)) + +(define-configuration home-mpris-ctld-configuration + (mpris-ctl (file-like mpris-ctl) "Mpris-ctl package to use.")) + +(define (home-mpris-ctld-shepherd-services config) + (list + (shepherd-service + (documentation "Run mpris-ctld") + (provision '(mpris-ctld)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append (home-mpris-ctld-configuration-mpris-ctl config) + "/bin/mpris-ctld")))) + (stop #~(make-kill-destructor))))) + +(define-public mpris-ctld-service-type + (service-type + (name 'home-hydroxide) + (description "Run mpris-ctld daemon for mpris-ctl support.") + (default-value (home-mpris-ctld-configuration)) + (extensions + (list + (service-extension home-shepherd-service-type + home-mpris-ctld-shepherd-services))))) -- 2.48.1