guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On the naming of System and Home services modules.


From: Ludovic Courtès
Subject: Re: On the naming of System and Home services modules.
Date: Tue, 28 Sep 2021 14:17:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi Andrew,

Andrew Tropin <andrew@trop.in> skribis:

> On 2021-09-23 22:08, Ludovic Courtès wrote:

[...]

>> Silly question, but why do we need to have two different configuration
>> record types in the first place?

To be clear: you’ll have to be very convincing as I know all too well
the cost of maintaining such a thing :-) and can already foresee that
this would also be annoying to users.

> 1. Different fields (for example system services in many cases wants to
> know the username, which will be used to run process from, home services
> will probably use the user's username and won't rely on this field, home
> services on the other hand can have something like xdg-flavor? or
> anything else unrelated to system services).
>
> Even if fields are not conflicting with each other, it's very likely
> that it will introduce a confusion: user of Guix Home on foreign distro
> will be guessing why there is a field in configuration record, which
> doesn't make sense for a home service.

Do you have specific examples?  The user name example isn’t a convincing
one for me, at least not in the abstract.

> 2. Different default values.  $HOME/mail or /var/spool/mail? Even if we
> can technically bypass those problems, semantically the values will be
> incorrect.

Again, any specific example?  How frequently does this problem occur?

It could be solved, say, by having a ‘home-service?’ Boolean in the
config, which default values would take into account.

>> Sharing configuration between Home and System sounds important to me: it
>> means users can easily move services from one to the other, which is
>> pretty big deal.  It also means we’d have much less code to maintain.
>>
>> Would that be feasible?  (Apologies if this has already been discussed!)
>
> I find records to be a very rigid and hard to reuse

We can discuss the suitability of records, but we need an immediate
solution to the problem, especially now that it’s in ‘master’.

Duplicating configuration records for each and every service could have
a huge maintenance cost that we’re probably not willing to pay.

>> Also, I proposed earlier a possible way to generate a Home service type
>> from the corresponding System service type—or, IOW, to generate a Home
>> service type graph from the System graph.  Does that sound feasible?
>
> Not sure what you mean here, can you share a link to the proposal or
> elaborate one more time, please.

I can’t find the message anymore.  The suggestion is to have helpers to
“rewrite” the System service type graph for Home, so you could do things
like:

  (define home-profile-service-type
    (system->home-service-type profile-service-type))

  (define home-mcron-service-type
    (system->home-service-type mcron-service-type))

because fundamentally, these two things are the same as their System
counterpart, except that they graph is rooted in ‘home-service-type’ (or
whatever it’s called) instead of ‘system-service-type’.

Of course there are exceptions, but it may be possible to do that for
quite a few services.

Thoughts?

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]