Hi Julien, Julien Lepiller <jul...@lepiller.eu> 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’s fine with you. Could you send an updated patch? BTW, I just checked and there’s at least one subtle difference between cups.scm and mail.scm: ‘define-configuration’ in cups.scm defines the constructor as a macro that calls ‘validate-configuration’: (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 <jul...@lepiller.eu> > Date: Sun, 20 Nov 2016 17:56:08 +0100 > Subject: [PATCH] services: Make dovecot and cups configuration abstractions > 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 are:") > + ; ,@(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’.