From patchwork Sat Feb 17 19:02:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 60464 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5E42827BBE9; Sat, 17 Feb 2024 19:04:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C044627BBE2 for ; Sat, 17 Feb 2024 19:04:04 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbPyW-0002tz-4S; Sat, 17 Feb 2024 14:03:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbPyT-0002tP-3e for guix-patches@gnu.org; Sat, 17 Feb 2024 14:03:45 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbPyS-0000iW-Ru for guix-patches@gnu.org; Sat, 17 Feb 2024 14:03:44 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbPym-0000YG-Rs for guix-patches@gnu.org; Sat, 17 Feb 2024 14:04:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67120] [PATCH v5 5/5] gnu: Add home-jellyfin-mpv-shim-service-type. Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sat, 17 Feb 2024 19:04:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67120 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67120@debbugs.gnu.org Cc: Ian Eure , ( , Andrew Tropin , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 67120-submit@debbugs.gnu.org id=B67120.17081966022032 (code B ref 67120); Sat, 17 Feb 2024 19:04:04 +0000 Received: (at 67120) by debbugs.gnu.org; 17 Feb 2024 19:03:22 +0000 Received: from localhost ([127.0.0.1]:33892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbPy6-0000Wc-7q for submit@debbugs.gnu.org; Sat, 17 Feb 2024 14:03:22 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52155) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbPy1-0000VU-PF for 67120@debbugs.gnu.org; Sat, 17 Feb 2024 14:03:18 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 981B85C005B; Sat, 17 Feb 2024 14:02:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 17 Feb 2024 14:02:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1708196572; x= 1708282972; bh=s0PR3ZU1C8nvhw56ja2ksQ/H0K0BZWytw3rzfqwWb64=; b=C ejOlcjU2SUFIwNEe6+cPXptJfUKIe3k+VChTLBEq0XXc8oPwA3ofnjGYxMOWiVKB /HfZT+WBLOM9HvlHjz/sDqq6cDS4i2VjOOV71CEKIN049bdl8E58OUDYLBZRKkle z5824Eq6sgCLhjPeqZpx4usB5dN4ho5gjyaKHzLASncZf4viP/+EApHvpBLgHAx+ hrrikwzBCb6g9hitL+C9JLe6zGHyghSi9nd9ck622huH2Cg+pM2ZcVBkNKIhm4M7 v1XcFHp3r1Y30RKf3suYH+4uFwtFjxoIGmClrC4tk903I911HPnaNy8w196ebANi xTOI2gN1aQfL/vmWnZNlQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708196572; x= 1708282972; bh=s0PR3ZU1C8nvhw56ja2ksQ/H0K0BZWytw3rzfqwWb64=; b=D IeUHoJe91Im9geT9w1IgnPucmJfNv5rtvqt4KG5n66Moae7OC9gej6bEd6bacJvR nuGpwI6JUhmsjo8kfmCN3vr9HI1U+g4gJ8o5mpdVo7ilxOFbofm/QE2a2RyaZv18 8bOtkNmuvuT6va73y3huccwW2dG66CNtnm8/MZR3PSInFmLuzlTEjVCwnZLhL7fU muSunNkIXWPqI6e6/kEBYq1do+IVxZSnGQY2gFuJwoWq6tlF3Mow068nZ0itffVJ nEwPzyHim1xJDWmZ9ofY/kOAKXGg/SfBS0V0VBbxGkCwDBL0pX2Qn3emTx+ulFkg hRxIRPLw83crArkEVBRFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeggdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggt rdhtvheqnecuggftrfgrthhtvghrnhepheffgefggeetgffhieeuudekudefueegueeute dtkeduledukedttdekvdegffejnecuffhomhgrihhnpehkohguihdrthhvpdhjvghllhih fhhinhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehirghnsehrvghtrhhoshhpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 17 Feb 2024 14:02:51 -0500 (EST) From: Ian Eure Date: Sat, 17 Feb 2024 11:02:40 -0800 Message-ID: <2c4777a3d17760fbef2b570d377812e437920525.1708196460.git.ian@retrospec.tv> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/home/services/media.scm (home-jellyfin-mpv-shim-service-type): New variable. * doc/guix.texi (Jellyfin Services): New section. * doc/guix.texi (Kodi Services): Add subheading. Change-Id: I037ab0602214fdaa1b032be51ff98ecf6b7ee16c --- doc/guix.texi | 17 +++++++++++++++++ gnu/home/services/media.scm | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 04119a5955..58981f96d5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46042,6 +46042,8 @@ Media Home Services @subsection Media Home Services @cindex kodi +@subsubheading Kodi Services + The @uref{https://kodi.tv, Kodi media center} can be run as a daemon on a media server. With the @code{(gnu home services kodi)} service, you can configure Kodi to run upon login. @@ -46074,6 +46076,21 @@ Media Home Services @end table @end deftp +@cindex jellyfin +@subsubheading Jellyfin Services + +The @code{home-jellyfin-mpv-shim-service-type} in the @code{(gnu home services media)} module runs a cast client for the @uref{https://jellyfin.org/, Jellyfin} media system. + +To enable, add this to your home services: + +@lisp +(service home-jellyfin-mpv-shim-service-type #f) +@end lisp + +@defvar home-jellyfin-mpv-shim-service-type +The type of the Jellyfin MPV Shim service. +@end defvar + @node Networking Home Services @subsection Networking Home Services diff --git a/gnu/home/services/media.scm b/gnu/home/services/media.scm index c6454dfe15..219bb97487 100644 --- a/gnu/home/services/media.scm +++ b/gnu/home/services/media.scm @@ -19,8 +19,10 @@ (define-module (gnu home services media) #:use-module (srfi srfi-26) #:use-module (gnu home services) + #:use-module (gnu home services desktop) #:use-module (gnu home services shepherd) #:use-module (gnu packages kodi) + #:use-module (gnu packages video) #:use-module (gnu services configuration) #:use-module (gnu services shepherd) #:use-module (guix records) @@ -66,3 +68,36 @@ (define home-kodi-service-type (description "Install and configure the Kodi media center so that it runs as a Shepherd service."))) + +(define (jellyfin-mpv-shim-shepherd-service _ignore) + (list (shepherd-service + (documentation "Jellyfin MPV Shim.") + (provision '(jellyfin-mpv-shim jellyfin-client)) + + ;; Depend on 'x11-display', which sets 'DISPLAY' if an X11 server is + ;; available, and fails to start otherwise. + (requirement '(x11-display)) + + (modules '((srfi srfi-1) + (srfi srfi-26))) + (start #~(lambda _ + (fork+exec-command + (list #$(file-append jellyfin-mpv-shim "/bin/jellyfin-mpv-shim")) + + ;; Inherit the 'DISPLAY' variable set by 'x11-display'. + #:environment-variables + (cons (string-append "DISPLAY=" (getenv "DISPLAY")) + (remove (cut string-prefix? "DISPLAY=" <>) + (default-environment-variables)))))) + (stop #~(make-kill-destructor))))) + +(define-public home-jellyfin-mpv-shim-service-type + (service-type + (name 'home-jellyfin-mpv-shim) + (extensions (list (service-extension home-shepherd-service-type + jellyfin-mpv-shim-shepherd-service) + ;; Ensure 'home-x11-service-type' is instantiated so we + ;; can depend on the Shepherd 'x11-display' service. + (service-extension home-x11-service-type + (const #t)))) + (description "Run Jellyfin MPV Shim.")))