Subject: [bug#46031] services: cuirass: Add "simple-cuirass-services".

From: Ludovic Courtès <[email-masked]>
Date: Mon, 22 Feb 2021 13:59:25 +0100

Hi!

Mathieu Othacehe <[email-masked]> skribis:

>> I wonder if it would make sense to allow users to pass directly a
>> manifest, as in (pseudo syntax):
>>
>>   (simple-cuirass-configuration
>>     (build (list (build-manifest … (local-file "my-manifest.scm"))))
>>     (channels …))
>
> It would be nice but Cuirass doesn't support specification update for
> now. Passing a manifest this way would require to drop the database
> content at each reconfiguration.

Ah yes, that wouldn’t be convenient.

>> What about exposing ‘simple-cuirass-configuration->specs’, and document
>> it such that one can do:
>>
>>   (service cuirass-service-type
>>            (cuirass-configuration
>>              (specifications
>>               (simple-cuirass-configuration->specs config))))
>
> I agree it feels nicer, however with this service I'd like to hide the
> dependencies to postgresql-service-type and
> postgresql-role-service-type. That's why "simple-cuirass-services"
> returns three services. Maybe you see another way?

When a service extends a service type, an instance of that service type
is automatically added if it’s missing (provided that service type has a
default value).  This happens in ‘instantiate-missing-services’.

So, if postgresql-role-service-type and postgresql-service-type have a
default value, simple-cuirass-service could extend them both (possibly
with a dummy value) and it would just work.

HTH!

Ludo’.