[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proposal: auto-instantiate services with a default value
From: |
Ludovic Courtès |
Subject: |
Proposal: auto-instantiate services with a default value |
Date: |
Tue, 09 Jan 2018 10:05:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
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?
Ludo’.