From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UOGNO2VE7WXXzAAAqHPOHw:P1 (envelope-from ) for ; Sun, 10 Mar 2024 06:25:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UOGNO2VE7WXXzAAAqHPOHw (envelope-from ) for ; Sun, 10 Mar 2024 06:25:58 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=retrospec.tv header.s=fm3 header.b=dnlDbBQU; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=gp8uttZ9; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710048357; a=rsa-sha256; cv=none; b=sMYcJEolYqS17OKQlbzNcHUvtP+bvuXO34AMACgXs8Q8qiK/loVJYKuZCauIN7wFEiUyXL 6+fjEWypwwfALvGludD1HmgA8lWo9OrhssxsXbFtKVz9uWAOb93rpQ6orKMZz4QAHLR4Fq BpNyKQ/rN61KWfOuz7nXen28VTkasA7W/BQNq3/Z9y3+urv6q0lLACz8+LGKo309EbxH/f YrHLsNYyeslAMoO35ZgKIQUZuE95QnANp4tKip0icR3MaTJn/jMw79YEiJ2eNgAmxIx8Z/ vad+ToVFG3GvREXWUlVU1ByFhPTgEyv+yDiK9vJplEoL3VB3yuXerj6O6Uz1HA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=retrospec.tv header.s=fm3 header.b=dnlDbBQU; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=gp8uttZ9; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710048357; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=rlrPKmL37zIzC0G7rP0KIfDxAhJ4UTtrlfJdHYwOHGI=; b=kUc7VtCRHGkvlOH8j/4MQ/sCliuT+OpTHFwVIV/M+V+dHnLR8H/B9oWvr9dHP3v76SioyE opWyzgORQTS3EXGmJXj3sISK7tyjckSRbitGrs87ZYcsZBmYnlfwF1f8Wa3JrU46hfVk1N 2rqwYzLwLUgr+Vv6bd8T3T1Zz+VZ9j38LxKbPJD6J+B0tGmx1IEZwaUNUlV3KGpcR0SfJW nLcYpKGfy4ejc4dtnolDBm3seVGwEApB8xiyaNI0x2LdBvfQrEzkIcq/a35KphOLSRd1kh SBOc8PJqDRlJ/dDI2ebVnfNMY5kpBKhw7+I2JQF2BNIWUGOS42LD1v7ujGQxuw== 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 B4B316EBBD for ; Sun, 10 Mar 2024 06:25:56 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjBgr-0003CV-Hv; Sun, 10 Mar 2024 00:25:41 -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 1rjBgf-0003C2-P6 for guix-patches@gnu.org; Sun, 10 Mar 2024 00:25:30 -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 1rjBgf-0004uN-Gm for guix-patches@gnu.org; Sun, 10 Mar 2024 00:25:29 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjBhC-0000f3-Gk for guix-patches@gnu.org; Sun, 10 Mar 2024 00:26:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69692] [PATCH] 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, 10 Mar 2024 05:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69692 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69692@debbugs.gnu.org Cc: Ian Eure , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by submit@debbugs.gnu.org id=B.17100483212487 (code B ref -1); Sun, 10 Mar 2024 05:26:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Mar 2024 05:25:21 +0000 Received: from localhost ([127.0.0.1]:35235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjBgX-0000e3-2M for submit@debbugs.gnu.org; Sun, 10 Mar 2024 00:25:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:56988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjBgS-0000dr-53 for submit@debbugs.gnu.org; Sun, 10 Mar 2024 00:25:19 -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 1rjBfu-00038x-NK for guix-patches@gnu.org; Sun, 10 Mar 2024 00:24:42 -0500 Received: from wfhigh7-smtp.messagingengine.com ([64.147.123.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjBfp-0004bB-F6 for guix-patches@gnu.org; Sun, 10 Mar 2024 00:24:42 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id 90063180008B; Sun, 10 Mar 2024 00:24:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 10 Mar 2024 00:24:35 -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:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1710048275; x=1710134675; bh=rlrPKmL37zIzC0G7rP0KI fDxAhJ4UTtrlfJdHYwOHGI=; b=dnlDbBQUu7F5SAMRb/XmtwQm6Ui+CVT5eYMVW bba5fzG4RoQ/sJfEv6tz6qpG70ozu+KRp/vlOBCNUsG4Lfgl01kupX+Ie4kiUso1 aGpvNQElBh8izhNMkMgA27Dw/1RFr83P4+mqpWDiApq5efck762nDroj7jtgrKrW uCs44YXbp+qYari1/qQDCLiM95lqbpMGgHV+enhNzJUVx/rOlRZ5Hy12QuNU3f3a k7kPXZiEh95Y0Lv2rFI5myyoE283wAaivw46vM3BZnmK+ng1Ae+CcSOQjBURdah/ LU3fHDix+QW6cC2RcI2B8gaeq1TA8xSlrPTA9LN2o+NJ0rA6A== 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:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1710048275; x=1710134675; bh=rlrPKmL37zIzC0G7rP0KIfDxAhJ4 UTtrlfJdHYwOHGI=; b=gp8uttZ9boyOVZVBa0UdCz4yb5yTRU8sqz9MYTu9yGTr DLOrb78X9zgEKALopJekjU0l1thHii/kdSLgzViJjfytB34mIxXdtcII16GSQna3 Lm1pkdjF141BEexTr4cZFH5N97P6R/FgBagx7j6xmLTHLj9lrxlZUMqnIOaYpIY2 wXMr5tRVk87V0nm65AnKXb+eeXYc9cun9DqY97rnk6Uy6/u+WJ9SSTFrkZYH9ZLP LVDskBytgUnVM/uRuFsISPG1Ym92WtJPAX2zD9bN8e6Z+rN4hi2PG9Yuf/mHD6w8 xOjRW2luTvUrJo8t6emmIHNoCERUUHSOvHRjs3rwzA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrieekgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekredtre dttdenucfhrhhomhepkfgrnhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgvtgdrthhv qeenucggtffrrghtthgvrhhnpeduleevheeiueevhefhvdeiieevleeigeekteeuiedule dvgedtffejteffueevtdenucffohhmrghinhepkhhoughirdhtvhdpjhgvlhhlhihfihhn rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epihgrnhesrhgvthhrohhsphgvtgdrthhv X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 10 Mar 2024 00:24:34 -0500 (EST) From: Ian Eure Date: Sat, 9 Mar 2024 21:24:26 -0800 Message-ID: <7d396f735f82369731c90195c7b8e7dc0fcf9acd.1710048182.git.ian@retrospec.tv> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.158; envelope-from=ian@retrospec.tv; helo=wfhigh7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -1.08 X-Spam-Score: -1.08 X-Migadu-Queue-Id: B4B316EBBD X-TUID: pcDbR/STbRrx Split off from 67120. * 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 858d5751bf..8a3aead56a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46383,6 +46383,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. @@ -46415,6 +46417,23 @@ 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 + +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."))) base-commit: 7758e63f7a89f53fbb7c7a265ae472af0a8dfab0 -- 2.41.0