GNU bug report logs - #69692
[PATCH] gnu: Add home-jellyfin-mpv-shim-service-type.

Previous Next

Package: guix-patches;

Reported by: Ian Eure <ian <at> retrospec.tv>

Date: Sun, 10 Mar 2024 05:26:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Skyler Ferris <skyvine <at> protonmail.com>
To: Ian Eure <ian <at> retrospec.tv>, 69692 <at> debbugs.gnu.org
Subject: [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type.
Date: Mon, 18 Mar 2024 22:14:08 +0000
[Message part 1 (text/plain, inline)]
Hi Ian,

I don't have the setup required to try running this service but 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 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-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.")))

Then, users can simply use (service home-jellyfish-mpv-shim-service-type) without having to specify #f manually And if the service ever changes in the future and this value becomes 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)

> +
> +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.

Would it make sense to launch this program automatically if it is not configured? Presumably if someone adds the service then they want to configure a server. The value passed to the service could be used to specify whether or not the program should automatically launch so that users who do not want this behavior can disable it (note that if you decide to implement this then the configuration value should be an instance of a new structure defined to store configuration for this service, not a simple boolean; again, this makes things easier in the future so that if you want to add more fields pre-existing code will still work).

Regards,
Skyler
[Message part 2 (text/html, inline)]

This bug report was last modified 36 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.