From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Composing service definitions (and maybe fmt) Date: Thu, 21 Jan 2016 22:27:45 +0100 Message-ID: <87zivyvd0u.fsf@gnu.org> References: <87oacloy61.fsf@dustycloud.org> <87fuxt5zh9.fsf@dustycloud.org> <87vb6ogmqw.fsf@dustycloud.org> <87si1rx5l4.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]:58700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMMlk-0004yA-8t for guix-devel@gnu.org; Thu, 21 Jan 2016 16:27:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMMlg-0004Mk-1z for guix-devel@gnu.org; Thu, 21 Jan 2016 16:27:52 -0500 In-Reply-To: (David Thompson's message of "Thu, 21 Jan 2016 09:12:49 -0500") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: "Thompson, David" Cc: guix-devel "Thompson, David" skribis: > On Wed, Jan 20, 2016 at 5:13 PM, Ludovic Court=C3=A8s wrot= e: > >> To me, the question is more about choosing between writing configuration >> file bindings and exposing upstream=E2=80=99s configuration file syntax,= as was >> discussed when Andy posted the Dovecot service. (To which I don=E2=80= =99t have >> a better answer than: let=E2=80=99s see on a case-by-case basis.) > > How about this: > > Procedures that return services should accept file-like objects when > configuration files are needed. When it makes sense (like with > elogind, dovecot, etc.), we can provide special procedures that take a > Scheme data structure and "compile" that to a file-like object in the > service's native configuration language. This way, we allow ourselves > to have the high-level Scheme configuration APIs we like while also > allowing the use of "raw" configuration files in situations where it > is unavoidable or the path of least resistance. I like it! When we provide Scheme data structures, we necessarily have a =E2=80=98foo-configuration->file=E2=80=99 procedure anyway, so it=E2=80= =99s just a matter of exposing it. Ludo=E2=80=99.