unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Divvying up service definitions
@ 2023-10-24 14:41 Bruno Victal
  2023-10-24 17:54 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  2023-11-07 15:56 ` Maxim Cournoyer
  0 siblings, 2 replies; 10+ messages in thread
From: Bruno Victal @ 2023-10-24 14:41 UTC (permalink / raw)
  To: guix-devel

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

-- 
Thanks,
Bruno.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-05  1:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2023-11-28 20:29     ` Bruno Victal
2023-12-05  1:23       ` Maxim Cournoyer
2023-11-16 14:49   ` Ludovic Courtès

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