From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: Proposal: auto-instantiate services with a default value Date: Tue, 09 Jan 2018 22:56:45 -0800 Message-ID: <87tvvuw6aa.fsf@gmail.com> References: <87y3l7wgf5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZAJk-0008P2-1X for guix-devel@gnu.org; Wed, 10 Jan 2018 01:56:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZAJg-0005xz-Vf for guix-devel@gnu.org; Wed, 10 Jan 2018 01:56:56 -0500 In-Reply-To: <87y3l7wgf5.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 09 Jan 2018 10:05:34 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: Guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) 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 =E2=80=98services=E2=80=99 field, you also need to add: > > (service mcron-service-type) > > because the former happens to require the latter. If you don=E2=80=99t d= o that, > you get an error message (see =E2=80=98fold-services=E2=80=99 in (gnu ser= vices)), and > then you go back to your config and add that line. > > This was intentional, but it=E2=80=99s annoying, especially when consider= ing > higher-level, complex services=E2=80=94imagine a MediaGoblin service: you > wouldn=E2=80=99t want to manually specify a dozen services that, to you, = are an > implementation detail you=E2=80=99d rather ignore. > > We discussed some time ago the possibility to automatically instantiate > services. Now that service types have default value, I think it=E2=80=99= 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=E2=80=99d just specify =E2=80=98rottlog-serv= ice-type=E2=80=99 and > an =E2=80=98mcron-service-type=E2=80=99 would be automatically added if i= t=E2=80=99s 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)? =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlpVuS4ACgkQ3UCaFdgi Rp110g//cIUfzJdOrFnxVLwFyubG0H9vQ7YAV2TaSd8tj0cMp3UF9nSWrZxnv9zE lNpjy35PDcrh0uT8zNptfeaelr2uhq+WReOz3lIihmyQJLIPKqqH67+0OATh1RH9 LicHDoyPSi5kuiW/4oxw/QWUKr2YcB8sz53+OuGN7v8lZglZiQGCBgXJxWLf6egI s3CPpv1+Dekf9F2W1ys4TjJ1V7/e+uNKjcFoAKfp7rQRShGXSnTVsv7usaiUJIX4 yeXFb2dUExBGg6+am05d8eP/u22JzBO40y6b/9y1SQgFxxCPPjdNID04XLLD7yyr QZM+j5Dhe61r/GxvWAwHakAuczeaZE3UH6imjVYAYAMqUrjPUsGbpUAmp8Aeeq0E 0s3G40cgj5z5lkge3oYlJv87TRw6UQ4jet1BLWa+fzAWP5XTQrNlM96Chd9ffjhQ oMCyiTRi4G3/A3mRQ9mcBLKXu8jTMI/ZrxMgxHheihK6y8XD0bt6IKuD+DCe8aMV lftgL7QapSU1cUsohfQGbNSnZgtVClcrj3xCOYlb5PzMRL5mClH/cB2vR4mN3Xb9 YbjEHjog/0QVu6CpCXc5XPxFm8LYLcJ5WeJERjOFe5QK9zHcQuvcsesx22U2GR7G dJxfKITU8dKM8mtvY8Onlx2+mut/EZ1/n7+gAr3Vzfh8S6uuoSI= =PbqV -----END PGP SIGNATURE----- --=-=-=--