From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id MCcBAhIv3maoBAEAe85BDQ:P1 (envelope-from ) for ; Sun, 08 Sep 2024 23:11:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id MCcBAhIv3maoBAEAe85BDQ (envelope-from ) for ; Mon, 09 Sep 2024 01:11:14 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=PuASxTZM; dkim=fail ("headers rsa verify failed") header.d=retrospec.tv header.s=fm3 header.b="V b9R7/F"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="e YBrgbq"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1725837073; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6LVyiBHDhMQafrp11ivMfRt4N9S0/8q+LNCs8vTfxBg=; b=NIPjS3e/Si8l+f7b3IN7xtADpqe8HOhxeWvZKfN8o8IAiBorOLjMqDzk3zBXPl10xjtt+Z bF3oQ2i6mAsVR/Ln06sEcVuS/vN+zjb08AjwvhDGBZ/0xL3HUg/3FbwXcTDtd/+KEGbjmH osekaxCvjJX6QIrrXmd2hDfzBrfS3PySGvDyjj+7w6poH5nHLStshPFHAGqAiOfUcRjYik OBxCVL9CwdXqABuJZ7j3viuykzZW3ud7NKHgSecoWFISDa9AmIq4jQa20YaDeBiSG8IYiF qbNHeNW3ZIpchDE1F4FR3sNRKAv6CBfjTqBOCiZOV42Y1vVffUnAwTI1wzYzOw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=PuASxTZM; dkim=fail ("headers rsa verify failed") header.d=retrospec.tv header.s=fm3 header.b="V b9R7/F"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="e YBrgbq"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1725837073; a=rsa-sha256; cv=none; b=LCXijxawfcrhI2TEfxO0nS3MHREL0OiLkc+l+IVGK9IFUMm4NEKs1B15vgeVXAX8AdrK8c ZmM1/JWXM9dL+ACSaMx/nrraPmipwRrZQM+/x6u76z7+GMYu4iEsop1iLXMqSR7cdpuZSF Qut41vFRTniRfVsy0Lt6gJD0wdputQQcVsBVNAA4O00NBkUBdYOPnJLWGDZ+rLC7fgsmn8 m/QtokMZTZ7SOMGGIuKZq6N4orDOIJ8g16O2Uuq4OXomielGgfffTVh+T+sSJyXXiibJMe RHB+Yqb3kZazeDsZIJX2q7faLWQaYxCHnbW4L2FiJmA37lypwNtPhccr1FPwtQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EA5B1745E8 for ; Mon, 09 Sep 2024 01:11:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snR3e-0000pE-Ts; Sun, 08 Sep 2024 19:11:03 -0400 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 1snR3c-0000os-CS for guix-patches@gnu.org; Sun, 08 Sep 2024 19:11:00 -0400 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 1snR3b-0001Nj-VB for guix-patches@gnu.org; Sun, 08 Sep 2024 19:10:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=6LVyiBHDhMQafrp11ivMfRt4N9S0/8q+LNCs8vTfxBg=; b=PuASxTZM0Sw1kGC9EM1rKxK4OOLUjg1z3LwaqXo72hJ2rk+HuhDXxyU7lVrnKnyQgtTD4fDIw1Mf+Dkg623UupoVcrQGiZ0bN4jTbZpQIlYC2k7AonF2IuZ1uGgzyiG/SjZG3OrQtSwkTS41ydHqf7wQP352t1Db34q38tV3qX5tc3nSbWNi0GxDVrqmnqvePGMl3Eqs8KTFu9g//Flpexf6XGB9MZ9+87J5EueF3wvBRRUlk8TQCqKrwGLeYbs43MkSjltWKl011AXm9TDwKTCUTPirudNRANUm8wyIY/EBRfUDROLjYM0zippTEeDdSGUoglQMHTzSJQnSctN4TQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snR3e-00026q-ML for guix-patches@gnu.org; Sun, 08 Sep 2024 19:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69692] [PATCH v2 1/1] gnu: Add home-jellyfin-mpv-shim-service-type. Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Sep 2024 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69692 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69692@debbugs.gnu.org Cc: Ian Eure Received: via spool by 69692-submit@debbugs.gnu.org id=B69692.17258370538080 (code B ref 69692); Sun, 08 Sep 2024 23:11:02 +0000 Received: (at 69692) by debbugs.gnu.org; 8 Sep 2024 23:10:53 +0000 Received: from localhost ([127.0.0.1]:60292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snR3V-00026E-07 for submit@debbugs.gnu.org; Sun, 08 Sep 2024 19:10:53 -0400 Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]:40833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snR3Q-00025h-3z for 69692@debbugs.gnu.org; Sun, 08 Sep 2024 19:10:51 -0400 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 290CE1140159; Sun, 8 Sep 2024 19:10:40 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Sun, 08 Sep 2024 19:10:40 -0400 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=1725837040; x= 1725923440; bh=6LVyiBHDhMQafrp11ivMfRt4N9S0/8q+LNCs8vTfxBg=; b=V b9R7/Fp6j973FGHYvlYxwXmP3kY7MoURoy4Ep0h3iIx1n0z5iqG4XrpWi6kKjE6T iMBtWVaYltSxO3Ml1oHCznXOpTYN93XVZjOxTWUkzzibnzPpL2OY7UjWgAC/25Hs iBCj7MWkSg+1En/gQ5R1PGRBsxrwALVUtsXN04oCEpfxJ5qIOWjCreoIBpA/sTja X6RB4+PTyApDOwyTXHWQHTRM44/LFMwsW4W8o46oa4C2guWhLDyFEc0QNFsnJnKB pANBEOSMKHn2csd/QXmn8OYCCR7QQwA2tz7YVO0avuQyVS7NvnjIWo+L4EnrK/L9 PLItK6Zz2UyznJPqPgomQ== 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=1725837040; x= 1725923440; bh=6LVyiBHDhMQafrp11ivMfRt4N9S0/8q+LNCs8vTfxBg=; b=e YBrgbqDW6K8HZNEERXZcEN3Pa0TFxudy9didYek47JQRHcNbj17mvyeOp8HLD48n hdgVe1YLTvC5j5MH4JZ1ty/QGvfkkRli12rXExuwx6/UTLKkyuPpiirtKou97DAm K5oxLXb9uwWOVAcWPzwA+SUKBVm4Rq/imI1DmlzfDdw8OdCtk+46KD9XAk24R6u7 +vsL0k0eTcs2OCgWbAcIxXr8I32uCvNwf70Ed1pZwbgxxJ2VTwbu8DN0fenubG6X AfmAtA65pfLd78PwazJ09FowlifRG0Ok3pvMTOlem1Hj0gum09146Y0mGDy/dXJt nPKuy1Js103inBtWD7J9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeiiedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghn sehrvghtrhhoshhpvggtrdhtvheqnecuggftrfgrthhtvghrnhepheffgefggeetgffhie euudekudefueegueeutedtkeduledukedttdekvdegffejnecuffhomhgrihhnpehkohgu ihdrthhvpdhjvghllhihfhhinhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhoshhpvggtrdhtvhdpnhgspghr tghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepieelieelvdesug gvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehirghnsehrvghtrhhoshhpvggt rdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 8 Sep 2024 19:10:39 -0400 (EDT) From: Ian Eure Date: Sun, 8 Sep 2024 16:10:20 -0700 Message-ID: <20240908231020.1251-2-ian@retrospec.tv> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240908231020.1251-1-ian@retrospec.tv> References: <20240908231020.1251-1-ian@retrospec.tv> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.12 X-Migadu-Queue-Id: EA5B1745E8 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.12 X-TUID: MsUDRM9elB42 * 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 | 19 +++++++++++++++++ gnu/home/services/media.scm | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 981ffb8c58..c60b350d06 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47072,6 +47072,8 @@ znc} for more information. @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. @@ -47104,6 +47106,23 @@ kodi} for more information. @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 + +The service only starts if @code{jellyfin-mpv-shim} has been configured with a remote server and credentials. This must be done manually, by launching @code{jellyfin-mpv-shim}. After configuring the server, the service will start automatically when you log in. + +@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..a7fcf75b06 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,43 @@ (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) + (srfi srfi-98))) + (start #~(lambda _ + ;; Only start if a server has been configured. + (if (file-exists? + (string-append + (get-environment-variable "XDG_CONFIG_HOME") + "/jellyfin-mpv-shim/cred.json")) + (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)))) + #f))) + (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."))) -- 2.45.2