From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: Re: Services can now have a default value Date: Sat, 22 Apr 2017 09:41:10 +1000 Message-ID: <8737d1nxbd.fsf@zancanaro.id.au> References: <87shl9qo7h.fsf@gnu.org> <877f2go3wn.fsf@zancanaro.id.au> <877f2gksbs.fsf@gnu.org> <8737d32abz.fsf@zancanaro.id.au> <87bmrr4ghh.fsf@gnu.org> <874lxjnzyx.fsf@zancanaro.id.au> <87bmrp8lk6.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]:44876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1iB2-0006lX-C2 for guix-devel@gnu.org; Fri, 21 Apr 2017 19:41:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1iAz-00015c-AF for guix-devel@gnu.org; Fri, 21 Apr 2017 19:41:24 -0400 In-reply-to: <87bmrp8lk6.fsf@gnu.org> 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 On Fri, Apr 21 2017, Ludovic Court=C3=A8s wrote: > A =E2=80=98define-service-type=E2=80=99 macro or similar could generate e= ither code the > current framework (with and and > ) or for SRFI-99-style records if we later to go that > route. > > So I think we should start by designing this macro. > > How does that sound? Great! I think that it's sensible to not break things for now, and we should be able to design the macro to do that. I'll have a go at it later today and see what I can come up with. (I'm not very familiar with guile/scheme libraries, but I have played around a fair bit with macros.) > Well I don=E2=80=99t know, perhaps in some cases it might make sense to > automatically instantiate things depended on. The advantage is that as > a user of the service (exim for instance) you don=E2=80=99t have to be aw= are of > the services it expects (improves separation of concern). > > So you could blissfully write just: > > (cons (service mediagoblin-service-type) > %base-services) > > and behind the scenes it would add an nginx instance, an mcron instance > with a couple of jobs, a rottlog instance, and so on. > > WDYT? My main concern would be making sure that all of our services have safe defaults that can be extended. It may lead to surprising outcomes if we have services spun up which do more than you expect. As an example, if someone requests exim to start as a dependency, we should make sure it doesn't turn you into an open relay by default. Carlo --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEwWt2bKTcV+mIZ20oCShLEsLiKqIFAlj6mJYACgkQCShLEsLi KqJmqAgAv8Xm+KiaTjgUtCU+dy2I/c3GhV4W9xRRlMQF0wlVXdkUJbLcox4C0y1U GuSYTajGMJIkYZSQaudHMoAkHRuoUca+PJi6Z3zow48l5ocYHJ1MLpfWd5AOjjMR +GnDtsv3WFFP1p4N5PS5sp1qt4CiFHB09p7XMo9o7zkZjeo+8SRxRquiOhfrGrk0 w75VwydGCj56Lt08S5aq+B6n1ASAyq1bruhFNAa5gP+v2C+ta2slrY6jqNaxrjIc CGSJENRJQ0ZTAvAmirnXsMLqVLAiwYpRoBz1IqyCc8c/NzoR5A6kffBPfayM3Hyy jdy/Im954TchZJ+10C9eW3fFvKNlIg== =PkTL -----END PGP SIGNATURE----- --=-=-=--