From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] services: Make dovecot and cups configuration abstractions available Date: Tue, 22 Nov 2016 23:49:23 +0100 Message-ID: <874m2z9ll8.fsf@gnu.org> References: <20161120180747.2e7b4b09@lepiller.eu> 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]:56667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9JsX-0004An-1N for guix-devel@gnu.org; Tue, 22 Nov 2016 17:49:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9JsT-0001Ou-S3 for guix-devel@gnu.org; Tue, 22 Nov 2016 17:49:29 -0500 In-Reply-To: <20161120180747.2e7b4b09@lepiller.eu> (Julien Lepiller's message of "Sun, 20 Nov 2016 18:07:47 +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: Julien Lepiller Cc: guix-devel@gnu.org Hi Julien, Julien Lepiller skribis: > since I will probably use it in openvpn-service and maybe in > nginx-service, I moved the definitions of the documentation that was > duplicated in cups and dovecot to services.scm. Is it the best place > for it? Thanks for looking into it! I would suggest moving it to a new (gnu services configuration) module instead, if that=E2=80=99s fine with you. Could you send an updated patch? BTW, I just checked and there=E2=80=99s at least one subtle difference betw= een cups.scm and mail.scm: =E2=80=98define-configuration=E2=80=99 in cups.scm d= efines the constructor as a macro that calls =E2=80=98validate-configuration=E2=80=99: (define-syntax-rule (stem arg (... ...)) (let ((conf (#,(id #'stem #'% #'stem) arg (... ...)))) (validate-configuration conf #,(id #'stem #'stem #'-fields)) conf)) The version in mail.scm does not do that, but I think we want to preserve it (and your patch does seem to preserve that already). Probably the are serializers that can be factorized as well. > From 9acc9456f4e61506105bc109298aedb66e31efd0 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Sun, 20 Nov 2016 17:56:08 +0100 > Subject: [PATCH] services: Make dovecot and cups configuration abstractio= ns > available. > > * gnu/services.scm: Add configuration-field, configuration-missing-field, > configuration-field-error, serialize-confgiuration, define-configuration, > validate-configuration, validate-configuration and generate-documetation. > * gnu/services/cups.scm: Use it. > * gnu/services/mail.scm: Use it. Please take some time to see the ChangeLog convention for this. > + ; (define (str x) (object->string x)) > + ; (define (generate configuration-name) > + ; (match (assq-ref documentation configuration-name) > + ; ((fields . sub-documentation) > + ; `((para "Available " (code ,(str configuration-name)) " fields a= re:") > + ; ,@(map > + ; (lambda (f) > + ; (let ((field-name (configuration-field-name f)) Why comment things out? Could it be moved to (gnu services configuration) as well? Thanks! Ludo=E2=80=99.