unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Ian Eure <ian@retrospec.tv>
To: Skyler Ferris <skyvine@protonmail.com>
Cc: 69692@debbugs.gnu.org
Subject: [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type.
Date: Wed, 15 May 2024 18:27:58 -0700	[thread overview]
Message-ID: <87v83ev84k.fsf@meson> (raw)
In-Reply-To: <8c8f0aee-f099-46ad-91f0-89e7b1dd789d@protonmail.com>

Hi Skyler,

Sorry for the extremely delayed response here.

Skyler Ferris <skyvine@protonmail.com> writes:

> 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)
>

Thank you for the suggestion, I’ll incorporate it and send a 
revised patch after we’re 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 
> 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?
>

I don’t think it would.  When it launches in an unconfigured 
state, you get a very generic "Server Configuration" window, with 
no icon or indication what server you’re configuring, or what for. 
It makes perfect sense if you run the program and that window 
appears, and not much sense at all if it just happens when you log 
in.


> Presumably if someone adds the service then they want to 
> configure a server.

Agreed.  However, configuring the server is a manual action, and 
it doesn’t feel burdensome to manually run the program to do it. 
There isn’t a good way to configure the remote server 
declaratively, since this process involves exchanging a username 
and password for an authentication token, which must be done over 
the network.  You probably wouldn’t want to commit your auth token 
to a repo 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 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).
>

Making auto-launch configurable doesn’t seem like a good idea to 
me.  It would only ever apply to the very first launch, and 
wouldn’t significantly change the bounds of the problem.  If the 
default is to launch unconfigured, you get the confusing behavior 
I want to avoid.  If the default is to not launch unconfigured, I 
don’t think anyone would ever change that setting -- it’s be much 
easier to launch the program than to change the setting and `guix 
home reconfigure'.

Thanks,

  — Ian




  reply	other threads:[~2024-05-16  1:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-10  5:24 [bug#69692] [PATCH] gnu: Add home-jellyfin-mpv-shim-service-type Ian Eure
2024-03-18 22:14 ` Skyler Ferris via Guix-patches via
2024-05-16  1:27   ` Ian Eure [this message]
2024-08-22 14:57     ` Ian Eure
2024-09-08 23:10 ` [bug#69692] [PATCH v2 0/1] " Ian Eure
2024-09-08 23:10   ` [bug#69692] [PATCH v2 1/1] " Ian Eure

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v83ev84k.fsf@meson \
    --to=ian@retrospec.tv \
    --cc=69692@debbugs.gnu.org \
    --cc=skyvine@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).