From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id EIT/B4C922VApAAAqHPOHw:P1 (envelope-from ) for ; Sun, 25 Feb 2024 23:21:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id EIT/B4C922VApAAAqHPOHw (envelope-from ) for ; Sun, 25 Feb 2024 23:21:52 +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="G d/QFWP"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="E Fj8R23"; 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=1708899711; 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=0rrwSIXkZ4O52b0bA/2i83lZkpcqn77g5Aj3GCuT4cQ=; b=f/xzTyfMiF194U4oJtbC/eMK0D2BjGXQHSVFyHaA8Em7MUg9ndu3/VLujMnCeoOXrViuWJ UHxKs0FaA2JEF5/LwzV5uAUPJBuKNf9vbxpikSqc/+rrfE58E2if4KvkC64Y0E1ffSrv03 rTygWxqUs1IOPt3mAz7F8/hFwIF447PBtKzSKg+0opjZF5xtwDEEGLAm4mPoyWml6tIYPd RqCtFEAiSOLMuZOsb+YYg9Qv7NRzv4squUq5+muzv7CGcbaY79YCcToPCCmAWRimOB7FxQ SgXMWlmbFxhOOERZTWnyLPCY89CiTVxE+9z8caEftx+vov4isbonWW0kCwPSoA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=retrospec.tv header.s=fm3 header.b="G d/QFWP"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="E Fj8R23"; 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=1708899711; a=rsa-sha256; cv=none; b=JYd+6zQAn3NeVK7sU2whncQE9c7O88+zJoWb18kjelx0dPkJ7QUt/VEbZTOaAWpmwib+I6 qREryYUSDLPi4LeD2fS+PSN+G4AVVhGy1ry7At++74GpjBgr+pUoiQc6nsOgVWIwG/k7ql +43MeU6ueiQk2sqtWiRo3wgeBXgMd0SdI2/vJB7CAmjUeITRGKmtL+wBWJuiPVf3vSr/pX G9YD/kHKqNL1P/SK7dAtWnp69/f1j/G+RsaJv7Z3v3HZffpBj7pr/pTEYy/fNx/eJG84uF dqoRaIspAPNecpkCZBJbl4XsoMpzkAV/TBzUFbPN0aWVLyB5umJj7Ipt6Tf/Ew== 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 EF1EB41D1C for ; Sun, 25 Feb 2024 23:21:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reMsO-00019c-KJ; Sun, 25 Feb 2024 17:21:40 -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 1reMsN-000190-5s for guix-patches@gnu.org; Sun, 25 Feb 2024 17:21:39 -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 1reMsM-0006i2-UZ for guix-patches@gnu.org; Sun, 25 Feb 2024 17:21:38 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reMsl-0006kn-Rf for guix-patches@gnu.org; Sun, 25 Feb 2024 17:22:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67120] [PATCH v6 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: Sun, 25 Feb 2024 22:22:03 +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.170889968725824 (code B ref 67120); Sun, 25 Feb 2024 22:22:03 +0000 Received: (at 67120) by debbugs.gnu.org; 25 Feb 2024 22:21:27 +0000 Received: from localhost ([127.0.0.1]:54869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reMsA-0006iD-Ns for submit@debbugs.gnu.org; Sun, 25 Feb 2024 17:21:27 -0500 Received: from wfhigh8-smtp.messagingengine.com ([64.147.123.159]:35343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reMs6-0006gu-Du for 67120@debbugs.gnu.org; Sun, 25 Feb 2024 17:21:23 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.west.internal (Postfix) with ESMTP id ACB8F180008A; Sun, 25 Feb 2024 17:20:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 25 Feb 2024 17:20:51 -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=1708899651; x= 1708986051; bh=0rrwSIXkZ4O52b0bA/2i83lZkpcqn77g5Aj3GCuT4cQ=; b=G d/QFWPBR3wluKc20+fjtmoylUH16j8wOtKYsQNqXL0DQ20sgZfnuxmQNiQoxJ/Vq SNG+uGHSx2e0cSs6i+BJ6p2rEpdWtGp3Eej3uCWJCCb2sMplhVh/5Kkk40sLme8K olqcKdJabgOA1wHwfTSJ4jOqmz68QD2iiZt8YpM5ha5adT88wzN9uI74z6hIMFgR QCI19XjNo9sRe2OQzdXqj/4qOCO+KLe+Ylc2dcXLuNbWsmTe+fkwiI/aIzOMmVVT TYm195DrBCF7+4l6NbcCAv0gSXGlWzEHFJ911r1A8OAyOL5ZBU9cTuj5ZevZMJHf dIU0IVblajeszZpITma/A== 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=1708899651; x= 1708986051; bh=0rrwSIXkZ4O52b0bA/2i83lZkpcqn77g5Aj3GCuT4cQ=; b=E Fj8R23Cmrk47wts/TDiex1dyoBjU5NihJ2yrUhNeZ98dZWGM+rGlzVj5pdLkqNSh sESPFrdGPbL6PQdzXGDA2qEFI6njL2XcYjP50iIbYrL1LJdMDXddEU5M7OcrD5P+ pzyA2NCbQ4/mH4guOone/PInVz7Gge9grniOt2Fojym+CbWrj+AaoEwzAgsJYe/3 v0LnMGv587EpsrBtFXUeCrHsCBGTx+lca6TnS8lGVGEAMGHzP1DlzCbw6C80sT96 FrKC07qK4/Q009EqtQuio77VmFL9CgwV4QrZNFQAcwF53uwkLXziUpcOFhhOdFR1 0k3e/t8EM7/nhgC7oLYgQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrgedtgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggt rdhtvheqnecuggftrfgrthhtvghrnhepheffgefggeetgffhieeuudekudefueegueeute dtkeduledukedttdekvdegffejnecuffhomhgrihhnpehkohguihdrthhvpdhjvghllhih fhhinhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehirghnsehrvghtrhhoshhpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 25 Feb 2024 17:20:50 -0500 (EST) From: Ian Eure Date: Sun, 25 Feb 2024 14:20:34 -0800 Message-ID: <6cb1e94800f6f8d57b574794549af0c693b89534.1708899540.git.ian@retrospec.tv> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-Migadu-Spam-Score: -3.87 X-Spam-Score: -3.87 X-Migadu-Queue-Id: EF1EB41D1C X-Migadu-Scanner: mx11.migadu.com X-TUID: ABxBg394EtMX * 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 671cdab6f8..f4d64f9df7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46103,6 +46103,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. @@ -46135,6 +46137,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."))) -- 2.41.0