guix-devel
[Top][All Lists]
Advanced

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

Re: Proposal: auto-instantiate services with a default value


From: Chris Marusich
Subject: Re: Proposal: auto-instantiate services with a default value
Date: Tue, 09 Jan 2018 22:56:45 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hello Guix!
>
> Currently on GuixSD, users have to explicitly specify all the services
> they need, recursively.  For instance, if you add:
>
>   (service rottlog-service-type)
>
> to your ‘services’ field, you also need to add:
>
>   (service mcron-service-type)
>
> because the former happens to require the latter.  If you don’t do that,
> you get an error message (see ‘fold-services’ in (gnu services)), and
> then you go back to your config and add that line.
>
> This was intentional, but it’s annoying, especially when considering
> higher-level, complex services—imagine a MediaGoblin service: you
> wouldn’t want to manually specify a dozen services that, to you, are an
> implementation detail you’d rather ignore.
>
> We discussed some time ago the possibility to automatically instantiate
> services.  Now that service types have default value, I think it’s a
> viable approach: if a service is required, and *if* it provides a
> default value, then we can automatically instantiate it.
>
> So in the example above, you’d just specify ‘rottlog-service-type’ and
> an ‘mcron-service-type’ would be automatically added if it’s not already
> there.
>
> How does that sound?

This sounds great to me!  It would be quite convenient.

What will we do in the situation where two services S and T both require
a service U, but S and T require different configurations of U?  In this
case, it's clear that either S or T (or both) requires a non-default
configuration of U, so maybe this is outside the scope of what you've
proposed.

Is it intended that if I wish to modify a service's dependent services,
I would continue to do so via the usual methods (e.g., modify-services)?

-- 
Chris

Attachment: signature.asc
Description: PGP signature


reply via email to

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