all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: Bruno Victal <mirai@makinata.eu>, guix-devel@gnu.org
Subject: Re: Divvying up service definitions
Date: Thu, 9 Nov 2023 09:15:29 +0200	[thread overview]
Message-ID: <ZUyHEZq_AU-0HFj7@3900XT> (raw)
In-Reply-To: <87pm0lk15w.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3498 bytes --]

On Tue, Nov 07, 2023 at 10:56:11AM -0500, Maxim Cournoyer wrote:
> Hi Bruno,
> 
> Bruno Victal <mirai@makinata.eu> writes:
> 
> > Hi,
> >
> > As the gnu/services and gnu/home/services grow, I think we should
> > consider divvying the services into stand-alone modules or
> > subdirectories.
> >
> > Consider the ⌜dovecot-service-type⌝ in gnu/services/mail.scm: as of
> > commit 'd22d2a05c389207f8cdcf824be7738b1499a987c' this service
> > definition is nearly 1600 lines long, with the remainder of the file
> > comprising of four other services with rudimentary support.
> >
> > It becomes troublesome working with such amalgamations as it makes it
> > hard to keep track of the used modules and bindings, especially when
> > define-configuration is used since the serializing procedures might be
> > used by various service definitions. Further complicating things is
> > 'define-maybe', whose use monopolizes the predicate and serializers for
> > a particular service definition.
> >
> > Now, I'm not saying that we should go and split everything into its own
> > module, I'm saying that we should be allowed to split some of them if
> > convenient (all subjective but I believe we can see that working with a
> > monolithic file in the kilolines where the interactions aren't obvious
> > is not fun, and that's without bringing in the hygienic issues
> > surrounding define-configuration and define-maybe).
> >
> > Some considerations (using dovecot-service-type as an example):
> > * Splitting this as gnu/services/mail/dovecot.scm.
> >   We preserve the logical grouping of the services (with the addition
> >   that, for extremely comprehensive definitions, these can be neatly
> >   organized into subdirectories. (same structure seen with gnu/*.scm)
> >   A drawback is that 'use-service-modules' might not work with this
> >   although I wonder whether 'use-service-modules' & co. provide any
> >   value if we are already doing '(use-modules (gnu) …)' to begin with.
> >   They look redundant IMO.
> >
> > * Splitting this as gnu/services/dovecot.scm.
> >   We keep it compatible with 'use-service-modules' at the cost of having
> >   a multitude of files under gnu/services, without any logical grouping
> >   (messy).
> 
> That's a great initiative!  I agree that multiple 'define-configuration'
> services per file can be a bit messy, having to use prefixes everywhere,
> making the definitions more verbose.
> 
> I don't have a strong preference of the caterogization of services, but
> would perhaps prefer the first one (gnu/services/mail/dovecot.scm),
> which could then make it easy to offer some interface as
> gnu/services/mail.scm that'd re-export all that is needed (would that
> work, or reintroduce the same top-level clashes?).

I assume the define-maybe's aren't public, so I'd guess that shouldn't
cause a problem as long as they aren't exported.  There's some services,
like ntpd and openntpd, which reuse the service user/group between them,
I think with those being intentional about making sure there aren't
clashes, or making sure they line up, would also be a good choice.

Or moving the define-maybes to the top of the file and reusing them
between services. Is that a possibility?

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-11-09  7:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 14:41 Divvying up service definitions Bruno Victal
2023-10-24 17:54 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-10-26 15:09   ` Bruno Victal
2023-10-28  9:11     ` Attila Lendvai
2023-11-09 14:55     ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-11-07 15:56 ` Maxim Cournoyer
2023-11-09  7:15   ` Efraim Flashner [this message]
2023-11-28 20:29     ` Bruno Victal
2023-12-05  1:23       ` Maxim Cournoyer
2023-11-16 14:49   ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=ZUyHEZq_AU-0HFj7@3900XT \
    --to=efraim@flashner.co.il \
    --cc=guix-devel@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=mirai@makinata.eu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.