From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: Composing service definitions (and maybe fmt) Date: Thu, 21 Jan 2016 09:12:49 -0500 Message-ID: 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]:35591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMFyo-0001RK-83 for guix-devel@gnu.org; Thu, 21 Jan 2016 09:12:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMFyk-0000Ib-Bv for guix-devel@gnu.org; Thu, 21 Jan 2016 09:12:54 -0500 Received: from mail-yk0-x236.google.com ([2607:f8b0:4002:c07::236]:34103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMFyk-0000IF-7F for guix-devel@gnu.org; Thu, 21 Jan 2016 09:12:50 -0500 Received: by mail-yk0-x236.google.com with SMTP id a85so49092192ykb.1 for ; Thu, 21 Jan 2016 06:12:49 -0800 (PST) In-Reply-To: <87si1rx5l4.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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel On Wed, Jan 20, 2016 at 5:13 PM, Ludovic Court=C3=A8s wrote: > 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=99= t 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. - Dave