@@ -25,6 +25,7 @@ (define-module (gnu home services shepherd-xyz)
#:use-module (gnu home services)
#:use-module (gnu home services shepherd)
+ #:use-module (gnu packages kodi)
#:use-module (gnu packages messaging)
#:use-module (gnu packages ssh)
#:use-module (gnu packages version-control)
@@ -35,6 +36,8 @@ (define-module (gnu home services shepherd-xyz)
#:export (home-git-daemon-configuration
home-git-daemon-service-type
+ home-kodi-configuration
+ home-kodi-service-type
home-ssh-agent-configuration
home-ssh-agent-service-type
home-znc-configuration
@@ -136,6 +139,44 @@ (define home-git-daemon-service-type
(description
"Install and configure the git-daemon as a shepherd service.")))
+
+;;;
+;;; Kodi.
+;;;
+(define-record-type* <home-kodi-configuration>
+ home-kodi-configuration make-home-kodi-configuration
+ home-kodi-configuration?
+ (kodi home-kodi-kodi ;file-like
+ (default kodi))
+ (extra-options home-kodi-extra-options ;list of string
+ (default '())))
+
+(define (home-kodi-services config)
+ "Return a <shepherd-service> for kodi with CONFIG."
+ (match config
+ (($ <home-kodi-configuration> kodi extra-options)
+ (let* ((kodi (file-append kodi "/bin/kodi"))
+ (command `(kodi
+ "-fs"
+ ,@extra-options))
+ (log-file (string-append %user-log-dir "/kodi.log")))
+ (list (shepherd-service
+ (documentation "Run the kodi media center.")
+ (provision '(kodi))
+ (start #~(make-forkexec-constructor '#$command
+ #:log-file #$log-file))
+ (stop #~(make-kill-destructor))))))))
+
+(define home-kodi-service-type
+ (service-type
+ (name 'home-kodi)
+ (default-value (home-kodi-configuration))
+ (extensions
+ (list (service-extension home-shepherd-service-type
+ home-kodi-services)))
+ (description
+ "Install and configure kodi as a shepherd service.")))
+
;;;
;;; Ssh-agent.