From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Proposal: auto-instantiate services with a default value Date: Tue, 09 Jan 2018 10:05:34 +0100 Message-ID: <87y3l7wgf5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYpqn-00026J-TO for guix-devel@gnu.org; Tue, 09 Jan 2018 04:05:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYpqi-0000zN-VI for guix-devel@gnu.org; Tue, 09 Jan 2018 04:05:41 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:57390) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYpqi-0000ye-PI for guix-devel@gnu.org; Tue, 09 Jan 2018 04:05:36 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id AB22E10904 for ; Tue, 9 Jan 2018 10:05:35 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P0jxJFeCbOW0 for ; Tue, 9 Jan 2018 10:05:35 +0100 (CET) Received: from ribbon (unknown [193.50.110.243]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 075F5108FA for ; Tue, 9 Jan 2018 10:05:34 +0100 (CET) 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: Guix-devel 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 do = that, you get an error message (see =E2=80=98fold-services=E2=80=99 in (gnu servi= ces)), and then you go back to your config and add that line. This was intentional, but it=E2=80=99s annoying, especially when considering 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, ar= e 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=99s 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-servic= e-type=E2=80=99 and an =E2=80=98mcron-service-type=E2=80=99 would be automatically added if it= =E2=80=99s not already there. How does that sound? Ludo=E2=80=99.