From unknown Wed Jun 18 23:16:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#69692 <69692@debbugs.gnu.org> To: bug#69692 <69692@debbugs.gnu.org> Subject: Status: [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. Reply-To: bug#69692 <69692@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:16:57 +0000 retitle 69692 [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. reassign 69692 guix-patches submitter 69692 Ian Eure severity 69692 normal tag 69692 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 10 00:25:21 2024 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 To: guix-patches@gnu.org Subject: [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. 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 X-Debbugs-Cc: ( , Andrew Tropin , Ludovic Courtès 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-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit Cc: Ian Eure X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 18 18:15:13 2024 Received: (at 69692) by debbugs.gnu.org; 18 Mar 2024 22:15:14 +0000 Received: from localhost ([127.0.0.1]:46822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmLGD-0004zE-F5 for submit@debbugs.gnu.org; Mon, 18 Mar 2024 18:15:13 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:11321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmLG4-0004xz-RA for 69692@debbugs.gnu.org; Mon, 18 Mar 2024 18:15:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1710800059; x=1711059259; bh=l0Dp2bpLr/bruZ+fpsQ1FIyUIyck8qh2VOxx/QTrMPw=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=yXxLZb9Zgf2/pVkBom5nICSJA7WeIfrQ8bIHuDCO38e+jCdZKCoR5+OoIh8m/+rBH zelqIT/F4c6nK1Zv1V1j6vI3JXcFmyt4o5twPilndZV6eOWlNuVsbCc5o1ub4r5mQi 1qn1QugPPHaNO7I1/fORc4iHbQjK1ZGTW6Uo4J60ZQnKPIs3KAt0DH+ks+eTJ/wPu3 1a99zyX02OyyfumrRC9sWXZpfiubz4C4rRrrhdTzs/Ease6iqhHv4HVbQV2sTc8Iad KM0FhZ/1uE710ztmJorgNSqtd7ibwIqbHo7n2tVl3y0Vbn6I+0Bi999Xd7w66cPi9/ +n+UB5r+FNkJw== Date: Mon, 18 Mar 2024 22:14:08 +0000 To: Ian Eure , 69692@debbugs.gnu.org From: Skyler Ferris Subject: Re: [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. Message-ID: <8c8f0aee-f099-46ad-91f0-89e7b1dd789d@protonmail.com> In-Reply-To: <7d396f735f82369731c90195c7b8e7dc0fcf9acd.1710048182.git.ian@retrospec.tv> References: <7d396f735f82369731c90195c7b8e7dc0fcf9acd.1710048182.git.ian@retrospec.tv> Feedback-ID: 40635331:user:proton MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_u9tnBbkuQwXyTdE4bv0QHFoxnEJk43xOhkNLEmmPoM" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69692 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --b1_u9tnBbkuQwXyTdE4bv0QHFoxnEJk43xOhkNLEmmPoM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 SGkgSWFuLAoKSSBkb24ndCBoYXZlIHRoZSBzZXR1cCByZXF1aXJlZCB0byB0cnkgcnVubmluZyB0 aGlzIHNlcnZpY2UgYnV0IDIgdGhpbmdzIHN0YW5kIG91dCB0byBtZSB3aGVuIHJlYWRpbmcgdGhy b3VnaCBpdC4KCk9uIDMvOS8yNCAyMToyNCwgSWFuIEV1cmUgd3JvdGU6Cgo+ICtUbyBlbmFibGUs IGFkZCB0aGlzIHRvIHlvdXIgaG9tZSBzZXJ2aWNlczoKPiArCj4gK0BsaXNwCj4gKyhzZXJ2aWNl IGhvbWUtamVsbHlmaW4tbXB2LXNoaW0tc2VydmljZS10eXBlICNmKQo+ICtAZW5kIGxpc3AKCllv dSBjYW4gYWRkIGEgZGVmYXVsdC12YWx1ZSBmaWVsZCB0byB0aGUgc2VydmljZSBkZWZpbml0aW9u IGxpa2Ugc286CgooZGVmaW5lLXB1YmxpYyBob21lLWplbGx5ZmluLW1wdi1zaGltLXNlcnZpY2Ut dHlwZQogIChzZXJ2aWNlLXR5cGUKICAgKG5hbWUgJ2hvbWUtamVsbHlmaW4tbXB2LXNoaW0pCiAg IChkZWZhdWx0LXZhbHVlICNmKQogICAoZXh0ZW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BzdGlsbCB3b3JrKS48YnIvPg0KICAgIDxici8+ DQogICAgUmVnYXJkcyw8YnIvPg0KICAgIFNreWxlcjxici8+DQogIA0KDQo8L2JvZHk+PC9odG1s Pg== --b1_u9tnBbkuQwXyTdE4bv0QHFoxnEJk43xOhkNLEmmPoM-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 15 21:49:35 2024 Received: (at 69692) by debbugs.gnu.org; 16 May 2024 01:49:35 +0000 Received: from localhost ([127.0.0.1]:45660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7QFS-0002zA-HV for submit@debbugs.gnu.org; Wed, 15 May 2024 21:49:35 -0400 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]:55747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7QFJ-0002z4-2h for 69692@debbugs.gnu.org; Wed, 15 May 2024 21:49:31 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 615E21381043; Wed, 15 May 2024 21:49:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 15 May 2024 21:49:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1715824157; x=1715910557; bh=BYBnHl6Nmg+FgD5owk5DrINiB7KcobkLWYe6F9lmUpw=; b= FnKyGfzoXVhje0fnF3IlrEXdHQBPLXciYgzGszSKre7Y15E2HnCVI3QnQoDzMFHe 2UHMzm1/P1zVHh1LiuBYGqEXzkW0cu9tt+kCylN8018t78i4leUZPNi0v596mlm4 XKgFirEjF0CCnmLJtKyutX2GXxYcdnp6tXDLF5RfL26c9NVeHTcQgG4HcIEfEpeP TdiYY/Co06FhhsYfamM3P6NoI5JoJEOqrNPH/kH1CRUVOAEwagsqdcL6RqxcSr3e LsYzT0XxEF3J9838Ch5YdpyC/MKgSWkhZtneI4IzvyJUdzPfJ6s/k/Q/mtqYZqkJ l106IPbi1iViYyXD1cZslg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm3; t=1715824157; x= 1715910557; bh=BYBnHl6Nmg+FgD5owk5DrINiB7KcobkLWYe6F9lmUpw=; b=B CH1/BmV7r6J97M4tQ/6VoJAcH5lPkPvbFSjGLgccKfLYlULEX9AHLRaAL0eZlPSW yIAMX9kK5+rOJMMmZRjbVjbNerDotuiv5Fq1C3Gg9BDjlBcYyflHkZ6iFkxsq6Mj 4xh7632poL49MRJ08BKvYeQeYlijkpwZc0+/x4z/3Fz8qQROk5cY878Cny/ganFM eumU7+NCd2koqd260brB9nLYnMNjh99CAxvqhNszPGQnINjwGvgu1hoR4WFR46ZW msYJSg0cAyGwC5z7zlUs6QU5lZB2gg/NhUUZeD2fD8cMr1DdwfSsgyxcfw7IHUMp 4PgzuLFjnv/ICAR+/ZG2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdegledghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpehffgfhvfevufffjgfkgggtgfesth hqredttderjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgrnhesrhgvthhrohhsphgv tgdrthhvqeenucggtffrrghtthgvrhhnpefhhfegieekfeegueehfeelteejhfeugfelvd eggfduvdevteelleetkeelffdtkeenucffohhmrghinhepghhnuhdrohhrghenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrh hoshhpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 May 2024 21:49:16 -0400 (EDT) References: <7d396f735f82369731c90195c7b8e7dc0fcf9acd.1710048182.git.ian@retrospec.tv> <8c8f0aee-f099-46ad-91f0-89e7b1dd789d@protonmail.com> User-agent: mu4e 1.8.13; emacs 28.2 From: Ian Eure To: Skyler Ferris Subject: Re: [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. Date: Wed, 15 May 2024 18:27:58 -0700 In-reply-to: <8c8f0aee-f099-46ad-91f0-89e7b1dd789d@protonmail.com> Message-ID: <87v83ev84k.fsf@meson> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: 69692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Skyler, Sorry for the extremely delayed response here. Skyler Ferris writes: > Hi Ian, > > I don't have the setup required to try running this service but=20 > 2 things stand out to me when reading through it. > > On 3/9/24 21:24, Ian Eure wrote: > > +To enable, add this to your home services: > + > +@lisp > +(service home-jellyfin-mpv-shim-service-type #f) > +@end lisp > > You can add a default-value field to the service definition like=20 > so: > > (define-public home-jellyfin-mpv-shim-service-type > (service-type > (name 'home-jellyfin-mpv-shim) > (default-value #f) > (extensions (list (service-extension=20 > home-shepherd-service-type > jellyfin-mpv-shim-shepherd-servic= e) > ;; Ensure 'home-x11-service-type' is=20 > instantiated so we > ;; can depend on the Shepherd 'x11-display'=20 > service. > (service-extension home-x11-service-type > (const #t)))) > (description "Run Jellyfin MPV Shim."))) > Then, users can simply use (service=20 > home-jellyfish-mpv-shim-service-type) without having to specify=20 > #f manually And if the > service ever changes in the future and this value becomes useful=20 > then you can provide a reasonable default without requiring > users to change their=20 > code. (https://guix.gnu.org/manual/en/html_node/Service-Reference.html) > Thank you for the suggestion, I=E2=80=99ll incorporate it and send a=20 revised patch after we=E2=80=99re in agreement on the launch behavior. > + > +The service only starts if @code{jellyfin-mpv-shim} has been=20 > configured with a remote server and credentials. This must be=20 > done manually, by launching @code{jellyfin-mpv-shim}. After=20 > configuring the server, the service will start automatically=20 > when you log in. > > Would it make sense to launch this program automatically if it=20 > is not configured? > I don=E2=80=99t think it would. When it launches in an unconfigured=20 state, you get a very generic "Server Configuration" window, with=20 no icon or indication what server you=E2=80=99re configuring, or what for.= =20 It makes perfect sense if you run the program and that window=20 appears, and not much sense at all if it just happens when you log=20 in. > Presumably if someone adds the service then they want to=20 > configure a server. Agreed. However, configuring the server is a manual action, and=20 it doesn=E2=80=99t feel burdensome to manually run the program to do it.=20 There isn=E2=80=99t a good way to configure the remote server=20 declaratively, since this process involves exchanging a username=20 and password for an authentication token, which must be done over=20 the network. You probably wouldn=E2=80=99t want to commit your auth token= =20 to a repo containing your home configuration, and Guix has no=20 facility for securely handling things like this. So it has to be=20 done by hand. > The value passed to the service could be used to specify whether=20 > or not the program should automatically launch so that users who=20 > do not want this behavior can disable it (note that if you=20 > decide to implement this then the configuration value should be=20 > an instance of a new structure defined to store configuration=20 > for this service, not a simple boolean; again, this makes things=20 > easier in the future so that if you want to add more fields=20 > pre-existing code will still work). > Making auto-launch configurable doesn=E2=80=99t seem like a good idea to=20 me. It would only ever apply to the very first launch, and=20 wouldn=E2=80=99t significantly change the bounds of the problem. If the=20 default is to launch unconfigured, you get the confusing behavior=20 I want to avoid. If the default is to not launch unconfigured, I=20 don=E2=80=99t think anyone would ever change that setting -- it=E2=80=99s b= e much=20 easier to launch the program than to change the setting and `guix=20 home reconfigure'. Thanks, =E2=80=94 Ian From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 22 11:00:05 2024 Received: (at 69692) by debbugs.gnu.org; 22 Aug 2024 15:00:05 +0000 Received: from localhost ([127.0.0.1]:38228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh9ID-0005A3-39 for submit@debbugs.gnu.org; Thu, 22 Aug 2024 11:00:05 -0400 Received: from fhigh6-smtp.messagingengine.com ([103.168.172.157]:38005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh9I9-000594-B7 for 69692@debbugs.gnu.org; Thu, 22 Aug 2024 11:00:03 -0400 Received: from phl-compute-01.internal (phl-compute-01.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id E67CD11519B8; Thu, 22 Aug 2024 10:59:09 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Thu, 22 Aug 2024 10:59:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type: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=1724338749; x=1724425149; bh=D5KDzfXEeySNW43O6Spd5D81JxRNsVdNiD2lHCAu9tY=; b= Jyzf9FBTLTjBcWZDRX75h4fUCuhi4+3EwIpCJlrIkU/uEiU/5OKKv33ZsbOXBYEN 5LmHwY5g05jETea+BZA4Ki4KIPfsr+Vz13cSCgbI3VN4iXfCShhv7yLRoXd2+7Ee wi3kTA02/thAVmnkoIXCeyOd17gfS+JFFDWO3BffE/wDoDJsRdmgXZ+qIZ1qEgrL hzi7fxjuYa5p+qikeAaKIb0ILpVdR5fYu/tedZw1NcSwD567V3NrPYB5OUq+196L 5IUP7nsnaTItyQcxhGq4xskVNWRrN2XcyARGxc5t9FyfR3gGE4xX1oszuw9fJ8lg 1cqzhPR6QG8Gp+aXe76/zw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=1724338749; x= 1724425149; bh=D5KDzfXEeySNW43O6Spd5D81JxRNsVdNiD2lHCAu9tY=; b=b rrL1VKWWrtxWl78M88EHJvtdy/D3a6f7Fy1NcV+t1qTSODw6xkEryTkrRYZpqeKa OUG9QH5JJ1035mu1c61KxYwLIZVmOxpocAnbHuWTqDuSdkgyDcrOIup7cl5mttn8 Jm3OAN0gOLH4ue4ZqJvFFGKrU9QtsirpAvM2Yt5LE38EH3PhRH+yyZmijA+lB0bx aU05cxHxENC/zfMVcjAbA6Uj0J5vwNuoXaWwN1EGjayQRuwfsdG8qqJ1yWXZVNMv Ux/HL9na5gEU562QTtmORK0wCM90ig69zCu3P7LMijyeW7Bayxpao7S0pkJFoJJ+ bsutvjxXSYIBZrp5l7vsg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvtddgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpehffgfhvf evufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgr nhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpefhhfegieekfeegue ehfeelteejhfeugfelvdeggfduvdevteelleetkeelffdtkeenucffohhmrghinhepghhn uhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehirghnsehrvghtrhhoshhpvggtrdhtvhdpnhgspghrtghpthhtohepvddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepieelieelvdesuggvsggsuhhgshdrghhnuhdroh hrghdprhgtphhtthhopehskhihvhhinhgvsehprhhothhonhhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Aug 2024 10:59:08 -0400 (EDT) References: <7d396f735f82369731c90195c7b8e7dc0fcf9acd.1710048182.git.ian@retrospec.tv> <8c8f0aee-f099-46ad-91f0-89e7b1dd789d@protonmail.com> <87v83ev84k.fsf@meson> User-agent: mu4e 1.8.13; emacs 28.2 From: Ian Eure To: Skyler Ferris Subject: Re: [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. Date: Thu, 22 Aug 2024 07:57:28 -0700 In-reply-to: <87v83ev84k.fsf@meson> Message-ID: <87wmk838oz.fsf@meson> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: 69692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Skyler, Did you have any other thoughts or feedback on this patch? I=E2=80=99d=20 like to see this in Guix proper. Thanks, =E2=80=94 Ian Ian Eure writes: > Hi Skyler, > > Sorry for the extremely delayed response here. > > Skyler Ferris writes: > >> Hi Ian, >> >> I don't have the setup required to try running this service but=20 >> 2 >> things stand out to me when reading through it. >> >> On 3/9/24 21:24, Ian Eure wrote: >> >> +To enable, add this to your home services: >> + >> +@lisp >> +(service home-jellyfin-mpv-shim-service-type #f) >> +@end lisp >> >> You can add a default-value field to the service definition=20 >> like so: >> >> (define-public home-jellyfin-mpv-shim-service-type >> (service-type >> (name 'home-jellyfin-mpv-shim) >> (default-value #f) >> (extensions (list (service-extension >> home-shepherd-service-type >> jellyfin-mpv-shim-shepherd-servi= ce) >> ;; Ensure 'home-x11-service-type' is >> instantiated so we >> ;; can depend on the Shepherd=20 >> 'x11-display' >> service. >> (service-extension home-x11-service-type >> (const #t)))) >> (description "Run Jellyfin MPV Shim."))) >> Then, users can simply use (service >> home-jellyfish-mpv-shim-service-type) without having to specify=20 >> #f >> manually And if the >> service ever changes in the future and this value becomes=20 >> useful >> then you can provide a reasonable default without requiring >> users to change their >> code. (https://guix.gnu.org/manual/en/html_node/Service-Reference.html) >> > > Thank you for the suggestion, I=E2=80=99ll incorporate it and send a=20 > revised > patch after we=E2=80=99re in agreement on the launch behavior. > >> + >> +The service only starts if @code{jellyfin-mpv-shim} has been >> configured with a remote server and credentials. This must be=20 >> done >> manually, by launching @code{jellyfin-mpv-shim}. After=20 >> configuring >> the server, the service will start automatically when you log=20 >> in. >> >> Would it make sense to launch this program automatically if it=20 >> is >> not configured? >> > > I don=E2=80=99t think it would. When it launches in an unconfigured=20 > state, > you get a very generic "Server Configuration" window, with no=20 > icon or > indication what server you=E2=80=99re configuring, or what for. It makes > perfect sense if you run the program and that window appears,=20 > and not > much sense at all if it just happens when you log in. > > >> Presumably if someone adds the service then they want to=20 >> configure a >> server. > > Agreed. However, configuring the server is a manual action, and=20 > it > doesn=E2=80=99t feel burdensome to manually run the program to do=20 > it. There > isn=E2=80=99t a good way to configure the remote server declaratively,=20 > since > this process involves exchanging a username and password for an > authentication token, which must be done over the network. You > probably wouldn=E2=80=99t want to commit your auth token to a repo=20 > containing > your home configuration, and Guix has no facility for securely > handling things like this. So it has to be done by hand. > > >> The value passed to the service could be used to specify=20 >> whether or >> not the program should automatically launch so that users who=20 >> do not >> want this behavior can disable it (note that if you decide to >> implement this then the configuration value should be an=20 >> instance of >> a new structure defined to store configuration for this=20 >> service, not >> a simple boolean; again, this makes things easier in the future=20 >> so >> that if you want to add more fields pre-existing code will=20 >> still >> work). >> > > Making auto-launch configurable doesn=E2=80=99t seem like a good idea to= =20 > me. > It would only ever apply to the very first launch, and wouldn=E2=80=99t > significantly change the bounds of the problem. If the default=20 > is to > launch unconfigured, you get the confusing behavior I want to=20 > avoid. > If the default is to not launch unconfigured, I don=E2=80=99t think=20 > anyone > would ever change that setting -- it=E2=80=99s be much easier to launch=20 > the > program than to change the setting and `guix home reconfigure'. > > Thanks, > > =E2=80=94 Ian From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 19:10:45 2024 Received: (at 69692) by debbugs.gnu.org; 8 Sep 2024 23:10:46 +0000 Received: from localhost ([127.0.0.1]:60287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snR3N-00025r-HY for submit@debbugs.gnu.org; Sun, 08 Sep 2024 19:10:45 -0400 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]:47793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snR3K-00025X-AN for 69692@debbugs.gnu.org; Sun, 08 Sep 2024 19:10:43 -0400 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id DC155138019C; Sun, 8 Sep 2024 19:10:33 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Sun, 08 Sep 2024 19:10:33 -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:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1725837033; x=1725923433; bh=qNEm/MY0N9cqwOBWadqUO ynrhqFsDb5MMMoL4ZPKMY8=; b=s45d2piNEJbPPShk6hGGS4W1pUNBhVzM7oxeB SD810RslNhmNKtdfv1vLj4cEsi9qCzjh+Z3tJlVHo/2KmXG88Td8uW2Fb0Il0Bgz /mt5/q3xC651C0G3TA4Q+lE2cfRWXT8gVznhokxrxZf1N8fHHPyhVxL/h33u2h0D iW4NouBKoJxHCQ1C4BcmTd90MZ40MtdsG5srDmXN8GvhJO5yin0Y9kxJ9IviAQ+z BNMoCnVlxxi1QKgJvSM8jRbubCy+yyPNHycIH5BmtfsmLXJ+eu3fkvxT+5WJvIf2 AdxR6hllQoAlj0DEcQ7K4FYNakZLXfrZ6MPitjUvY7XnNTXpA== 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=1725837033; x=1725923433; bh=qNEm/MY0N9cqwOBWadqUOynrhqFs Db5MMMoL4ZPKMY8=; b=YAbLiHBHgNgR7J9a/fd83psePioILtMPbmgccdi76y4f iNALYyycr+TznZAGh+V88rx/l1YxP9prYaLEixtIdrXFR3CkPo1dLzXqzJ2hLnVp +NXVvuMJaKlmjZHHGcat2HFT5L4Ln0QxnuyLv/g67xAudL/5sBuN0OD9Br7ArAxK iHIV0m5X7gJJYwx5Wm6F0ZkKuotW8hcjiSx4QBLvH06DkXcamhIJgi3omrJ3UUtm cOnrdW2LYHEXdID/25vUzTSzmLAW/dquLSlKbePe/6Xls74Vwa5WY0cArT+I47lM tRJ2Vf/jnecug279B+v1XqZf8d3y8J8Vc1vv3MY7YA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeiiedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffoggfgsedtkeertdertddtnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehr vghtrhhoshhpvggtrdhtvheqnecuggftrfgrthhtvghrnhephfeiveeliedukeffhefhle eijedtveelleetgefggfehkeeljeehtdeguddvvefgnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhvpd hnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeeileei ledvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepihgrnhesrhgvthhroh hsphgvtgdrthhv X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 8 Sep 2024 19:10:32 -0400 (EDT) From: Ian Eure To: 69692@debbugs.gnu.org Subject: [PATCH v2 0/1] gnu: Add home-jellyfin-mpv-shim-service-type. Date: Sun, 8 Sep 2024 16:10:19 -0700 Message-ID: <20240908231020.1251-1-ian@retrospec.tv> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: Ian Eure X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Refreshed patch, rebased onto current master. Ian Eure (1): gnu: Add home-jellyfin-mpv-shim-service-type. doc/guix.texi | 19 +++++++++++++++++ gnu/home/services/media.scm | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) -- 2.45.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 08 19:10:53 2024 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 To: 69692@debbugs.gnu.org Subject: [PATCH v2 1/1] gnu: Add home-jellyfin-mpv-shim-service-type. 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-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: Ian Eure X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 12:42:16 2025 Received: (at 69692) by debbugs.gnu.org; 15 Feb 2025 17:42:16 +0000 Received: from localhost ([127.0.0.1]:57751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tjMBD-0005Zw-Pk for submit@debbugs.gnu.org; Sat, 15 Feb 2025 12:42:16 -0500 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]:51467) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tjMBA-0005Zf-BJ for 69692@debbugs.gnu.org; Sat, 15 Feb 2025 12:42:13 -0500 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id CFE6811400AA; Sat, 15 Feb 2025 12:42:06 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sat, 15 Feb 2025 12:42:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm2; t=1739641326; x=1739727726; bh=+T RumMSEpUxb8Mq8Ymp7M1npXql7aPTL7CfMIZPFOYk=; b=tRRv4mHGiTU46YFjq9 gIBqjgu+fwSP3nYdyQpNqDMYpyuuUd6lQfrHxUnkkwDWpm+PvSNtWLOVhANczDFp UcNqd+sh9wFpNdO9TMbccExjQ3CLRsa0kxXEIi5uBRKr6YQN71K4iyAWE8AGvjVv 7bXKM/PUpoj7BDHgaOq4Nx+Ij74hiCQKKIXiFdSrAGz9nSM4HravhTtU9TsCWReP SP1ito7GNF6H0Hz/msLQJOxNXivVhmHHj5jKHMoQoubD66Qk92t31oAU8NFyvzMw 9l64OHy2jtsxnDfpLG6UE1ktPBxEPEzRbinj9rIHFso+oB47jl9B/9ht49w3NKKo Cugg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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-sender:x-me-sender:x-sasl-enc; s= fm3; t=1739641326; x=1739727726; bh=+TRumMSEpUxb8Mq8Ymp7M1npXql7 aPTL7CfMIZPFOYk=; b=W2tyFr9+cPooQ1Ge1v1/5pq//fnNQ/6RmYXNWGyt4knl eXvMRvE0iezCdjht/Fk8klpS5TjvyPLfVTKjUQ0fiCs/ENbNlXjmw3FcPFjc3xNZ cw+NErrPUGLwZ4lRH14XMHrarK0zVuTCc0aweRnYtckEO+WC7+vJCgCSNCTt/nDZ qb+yetr6wzimQumVoysouaVbVhnNWrJHeu8gjwp+TU7p02W4KZn/8gIzuqKfI9pM fka0fa9B08ex1MtuVKO4qB4KYKmMijyjkTjsSzPnITMWm/o83PvOoledGrIWdAy8 LYf1xrTGZYgXRqxWBckH8FZ+5eA+yzn+lczsoyLWDQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehfedujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvve fufgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghn sehrvghtrhhoshhpvggtrdhtvheqnecuggftrfgrthhtvghrnheptdetkeffffefiefhue ekvdeiueegieegffdthfelveelgfdtvdfhtdduheffuedvnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrth hvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeei leeiledvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshhkhihvihhnvg esphhrohhtohhnmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 15 Feb 2025 12:42:05 -0500 (EST) From: Ian Eure To: Skyler Ferris Subject: Re: [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type. User-Agent: mu4e 1.12.8; emacs 29.4 Date: Sat, 15 Feb 2025 09:42:05 -0800 Message-ID: <87cyfjnlzm.fsf@retrospec.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: 69692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Skyler, Pinging on this since it=E2=80=99s been nearly a year since I sent the=20 patch. I have commit privileges now, and am inclined to rebase=20 and push unless someone objects. -- Ian From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 21 20:12:15 2025 Received: (at 69692) by debbugs.gnu.org; 22 Apr 2025 00:12:15 +0000 Received: from localhost ([127.0.0.1]:41135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u71FG-0005fp-Vg for submit@debbugs.gnu.org; Mon, 21 Apr 2025 20:12:15 -0400 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]:50651) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u71FC-0005fY-Cm for 69692@debbugs.gnu.org; Mon, 21 Apr 2025 20:12:12 -0400 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9E3D311400C5; Mon, 21 Apr 2025 20:12:04 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Mon, 21 Apr 2025 20:12:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm1; t=1745280724; x=1745367124; bh=x2 5KN6c1k3ihBJrDHthYEmQbpfZJ1nbFdrDa6VNb/Bs=; b=iFxfy3n45x0XWx04rZ oajaifc3QKVW7Wvhf20sIn5h7MFosB/FLFWqerDup7itLXkHgrkA9Eow0xbmZgf3 gQ89Eh5nf9M6C8MO0zNlKixODgKPFEC7CkctohOQGmVD+EDIi6Lf8G/Wksh3m3lD 1+YGrMXFEcccDpC+Oem4rejU5AfL2DAVSpau/pGBp/oJQhkGisqEWyH2ozsRt3rw 5GGXltWK6IcjzAtvHzXzVNng16i4Fbm0kGp/6DxzpnnvwlmpjPifgk60pMlXYNhn Ck9yHAuBtoQGjcN42QwRaHorO6ttc/iV7Xh8YlL4EhVPE8VKzp5eL7Oaxe/CZZwE CPqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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-sender:x-me-sender:x-sasl-enc; s= fm2; t=1745280724; x=1745367124; bh=x25KN6c1k3ihBJrDHthYEmQbpfZJ 1nbFdrDa6VNb/Bs=; b=kNMhEjoPhW/Dn6802FTYYPcdgAr0wwz27563vqkr+xeB U9lEoiluK9+KflFc3kkZmcVMMkT8cv5R0t+zJinXdIyUO3OXROqG4joZn4eboh1o NeqWq5EdBwqkrLwNWpyrtbQlqG9pd8CtgNlD3xAfIud2vZQXgkfMT8H73Kxr4FxC 2KmoSPEWtGyut6MmY0Wx2/KQBLb8KOySAZPxl8yKfbknjofB1vzagduV1/tkya/u ysu9hacKPuy+NDbD9lx9LEpS5A+hTcMGR4mLeaNb4ajcf+NGr4oo6gIZspRvrAaa ZdnB6YMXjjhwD2XPC4bsogyHXrdlGC8+cCGe2a6kMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvgedvvdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf evufffkffogggtgfesthekredtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgr nhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpeefgeejhedtheevff etleffheduudefueehfeevgeehtefghfffffeklefgvdevgfenucffohhmrghinhepkhho ughirdhtvhdpjhgvlhhlhihfihhnrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhvpdhnsggp rhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeeileeiledvse guvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepihgrnhesrhgvthhrohhsphgv tgdrthhv X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Apr 2025 20:12:03 -0400 (EDT) From: Ian Eure To: 69692@debbugs.gnu.org Subject: [PATCH v3] gnu: Add home-jellyfin-mpv-shim-service-type. Date: Mon, 21 Apr 2025 17:11:47 -0700 Message-ID: <20250422001149.19852-1-ian@retrospec.tv> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: Ian Eure X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * 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 | 28 ++++++++++++++++++ gnu/home/services/media.scm | 59 ++++++++++++++++++++++++++++++++++++- 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bf9cb47478..988c2d69d4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -50426,6 +50426,8 @@ an example of a service and its configuration that you could add to the @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. @@ -50861,6 +50863,32 @@ mouse bindings. @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) +@end lisp + +The service starts only 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 +Type of the service which launches Jellyfin MPV Shim. +@end defvar + +@deftp {Data Type} home-jellyfin-mpv-shim-configuration +Available @code{home-jellyfin-mpv-shim-configuration} fields are: + +@table @asis +@item @code{package} (default: @code{jellyfin-mpv-shim}) (type: package) +The Jellyfin MPV Shim package to use. +@end table +@end deftp + @node Networking Home Services @subsection Networking Home Services diff --git a/gnu/home/services/media.scm b/gnu/home/services/media.scm index c6454dfe15..1fd11e0e16 100644 --- a/gnu/home/services/media.scm +++ b/gnu/home/services/media.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Janneke Nieuwenhuizen +;;; Copyright © 2024, 2025 Ian Eure ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,14 +20,20 @@ (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 packages) #:use-module (guix records) #:use-module (guix gexp) #:export (home-kodi-configuration - home-kodi-service-type)) + home-kodi-service-type + + home-jellyfin-mpv-shim-configuration + home-jellyfin-mpv-shim-service-type)) ;;; @@ -66,3 +73,53 @@ (define home-kodi-service-type (description "Install and configure the Kodi media center so that it runs as a Shepherd service."))) + +(define-configuration home-jellyfin-mpv-shim-configuration + (package + (package jellyfin-mpv-shim) + "The Jellyfin MPV Shim package to use")) + +(define (jellyfin-mpv-shim-shepherd-service config) + (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 + (home-jellyfin-mpv-shim-configuration-package config) + "/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)))) + (default-value (home-jellyfin-mpv-shim-configuration)) + (description "Run Jellyfin MPV Shim."))) -- 2.49.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 22 00:20:11 2025 Received: (at 69692) by debbugs.gnu.org; 22 Apr 2025 04:20:11 +0000 Received: from localhost ([127.0.0.1]:42808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u757C-0008Jv-QI for submit@debbugs.gnu.org; Tue, 22 Apr 2025 00:20:11 -0400 Received: from mail.boiledscript.com ([2a01:4f8:242:4aeb::42]:34114) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7578-0008F6-N1 for 69692@debbugs.gnu.org; Tue, 22 Apr 2025 00:20:08 -0400 Date: Tue, 22 Apr 2025 12:19:42 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=mail; t=1745295604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SAhqISBRZN9BEAwP7WZjU4jVMRxRCrBgckPiCObI5JY=; b=awlROp2k2uuJLHMENMAQgLqIdnjN5cNhd5HW6/6OkOBaejdN5zTCJEr/QWYuqy1ePE3GO/ lYDvA4fF/RvJ4xOdlTkCohtrtujZ6QMwlZPpfgv4q7rORndZ0/aMQRnRm4gGte7rWpYy8P a0hkfXIndHQZawRquxM8LnteBAYVZSG6DA3sWugy3IXgKE2owwGwugYkxPIyA6+VzDjaDn 5WKN7eh+hmLwuQjDdoZ3zi4JqL8MG8577A3TTmqLTwYc2cH2B3x7rMt/L8/VIhPy+x6AZb 6cFWnmjlaBIQ0NMYBU2uq158t9HSJNIf+ANhtB3WahrBJoxIQo1CTCgxdxv4Lw== Message-ID: <8734e0ltep.wl-hako@ultrarare.space> From: Hilton Chain To: Ian Eure Subject: Re: [bug#69692] [PATCH v3] gnu: Add home-jellyfin-mpv-shim-service-type. In-Reply-To: <20250422001149.19852-1-ian@retrospec.tv> References: <7d396f735f82369731c90195c7b8e7dc0fcf9acd.1710048182.git.ian@retrospec.tv> <20250422001149.19852-1-ian@retrospec.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69692 Cc: 69692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Tue, 22 Apr 2025 08:11:47 +0800, Ian Eure wrote: > > [...] > + ;; Inherit the 'DISPLAY' variable set by 'x11-display= '. > + #:environment-variables > + (cons (string-append "DISPLAY=3D" (getenv "DISPLAY")) > + (remove (cut string-prefix? "DISPLAY=3D" <>) > + (default-environment-variables)))) > + #f))) I think this is not the truth (also for existing services using it), =A1get= env=A2 is called before starting services, see https://issues.guix.gnu.org/76619#8 for details. > + (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-servi= ce) > + ;; Ensure 'home-x11-service-type' is instantiated s= o we > + ;; can depend on the Shepherd 'x11-display' service. > + (service-extension home-x11-service-type > + (const #t)))) > + (default-value (home-jellyfin-mpv-shim-configuration)) > + (description "Run Jellyfin MPV Shim."))) > -- > 2.49.0 Thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 11 22:10:54 2025 Received: (at 69692) by debbugs.gnu.org; 12 May 2025 02:10:54 +0000 Received: from localhost ([127.0.0.1]:48569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uEId3-0007kW-SM for submit@debbugs.gnu.org; Sun, 11 May 2025 22:10:54 -0400 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]:38955) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uEIcz-0007kF-PZ for 69692@debbugs.gnu.org; Sun, 11 May 2025 22:10:51 -0400 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id D67701140126; Sun, 11 May 2025 22:10:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sun, 11 May 2025 22:10:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm2; t=1747015843; x=1747102243; bh=Q7 7omqMYqu1paadlH77XwnqrDpxi3L6kKSC3W3mlzHM=; b=ZRPaFXekbWpa3UJxst P0Bbt6docnEXMBiCGFs2HOeUrQU3vhkpW19yHfoY+q+qmkUSp/9ACMvE31l9Azel Ikzk6on39+W3qHeFl0uWlhOXOV+Ux6HPJ1wr5pfy67mWGACuh7fJAPd8BxSo2K2q iQFY34mIXvGI9H27NTe7p4xNSvaKS5Ahs5wgbGS/iERN2uIDebX3EDaYCCPVzltZ FCJPQDOFopgQcwsuZb34fbdTgzEF3+323YrMhfPyfe7S/p3cJR7HLLfSLy0Onb+y rLqHbohjC8rYwBwF2V6r2luzG0Jztuu/mtA83EMonbj/AA1KVtUUaHz5e9ssVJ0f 86Vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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-sender:x-me-sender:x-sasl-enc; s= fm3; t=1747015843; x=1747102243; bh=Q77omqMYqu1paadlH77XwnqrDpxi 3L6kKSC3W3mlzHM=; b=cKFO1orxzvwRJ9u7hOUXvDnCkh+AnL8R1/VhGiKCtniF aRtVsmCSx0h+pKOFNF/+h4Pd7j71mwAJj8Kle/OZ947iur/YTPYhA6ojW8xSgzW7 rRaMAhvW5gJ10ldzbU3Ov0bXpsvB7TS/ux7xNEzpRZCEqIvuUL/XDOI1aDQzETzX T1eCm+mTD872S0nxl2FEa9F2CMMTSWo3rFLCwEGpc9V8KN/qJncpwRWy5QIZQcap 09bn8LGHGfDu6ynugDD9oTfCX8v+2A9gx7Ov4T9ybGs8pLQl0S9gO9NirD9S2+LU ntYMOaELJepQ4hNeVxmgPeuXeFMBgvgWFRtE5wxXTQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftddttddvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf evufgffffkgggtgfesthhqredttderjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgr nhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpeetuefgleeikefhhf ehieffteffiefgfeeuueeggeffleegjeduveeigeeljefgkeenucffohhmrghinhepghhn uhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehirghnsehrvghtrhhoshhpvggtrdhtvhdpnhgspghrtghpthhtohepvddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepieelieelvdesuggvsggsuhhgshdrghhnuhdroh hrghdprhgtphhtthhopehhrghkohesuhhlthhrrghrrghrvgdrshhprggtvg X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 11 May 2025 22:10:42 -0400 (EDT) From: Ian Eure To: Hilton Chain Subject: Re: [bug#69692] [PATCH v3] gnu: Add home-jellyfin-mpv-shim-service-type. User-Agent: mu4e 1.12.9; emacs 29.4 Date: Sun, 11 May 2025 19:10:42 -0700 Message-ID: <87y0v260kd.fsf@retrospec.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 69692 Cc: 69692@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Hilton, Hilton Chain writes: > On Tue, 22 Apr 2025 08:11:47 +0800, > Ian Eure wrote: >> >> [...] >> + ;; Inherit the 'DISPLAY' variable set by=20 >> 'x11-display'. >> + #:environment-variables >> + (cons (string-append "DISPLAY=3D" (getenv=20 >> "DISPLAY")) >> + (remove (cut string-prefix?=20 >> "DISPLAY=3D" <>) >> +=20 >> (default-environment-variables)))) >> + #f))) > > I think this is not the truth (also for existing services using=20 > it), =E2=80=98getenv=E2=80=99 is > called before starting services, see=20 > https://issues.guix.gnu.org/76619#8 for > details. Yeah, hmm, I see. Is there anything worth changing in this=20 service at this point? Seems like it=E2=80=99s need an update whenever=20 the graphical-display service changes land. Thanks, -- Ian