From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] make nginx service extensible Date: Tue, 03 Jan 2017 14:39:27 +0100 Message-ID: <87pok4460g.fsf@gnu.org> References: <20161213215615.5518d4c0@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]:36815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOPJO-0002eL-Fy for guix-devel@gnu.org; Tue, 03 Jan 2017 08:39:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOPJL-0004mS-CL for guix-devel@gnu.org; Tue, 03 Jan 2017 08:39:34 -0500 In-Reply-To: <20161213215615.5518d4c0@lepiller.eu> (Julien Lepiller's message of "Tue, 13 Dec 2016 21:56:15 +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, Sorry for the looong delay! At last I got around to reviewing these patches from last year. :-) Julien Lepiller skribis: > From 52f220a2bb5a7186c9dde79b6d9a419bc58feec4 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Tue, 13 Dec 2016 20:44:31 +0100 > Subject: [PATCH 1/3] gnu: services: Rename nginx vhosts to server. > > * gnu/services/web.scm (nginx-vhost-configuration): Rename to... > (nginx-server-configuration): ...this. > --- > doc/guix.texi | 20 +++++++++--------- > gnu/services/web.scm | 60 ++++++++++++++++++++++++++--------------------= ------ > 2 files changed, 40 insertions(+), 40 deletions(-) Pushed with an adjusted commit log to mention changes in guix.texi as well. http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D3b9b12ef49d0b6d7a8= 887513acb9e9a1a8325148 > From 237557b0e0cff28dc53f384f2297f658bff06459 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Tue, 13 Dec 2016 20:48:16 +0100 > Subject: [PATCH 2/3] services: Fix multiple index and server name > > * gnu/services/web.scm (config-domain-strings, config-index-string): sepa= rate > names with a space. Pushed. http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D4e9ae301ce759f9cf9= a09f47dc521d0bc8409f6c > From a0e24caf1f8a7d89c4ecafc57f9cfe2c098dc89c Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Tue, 13 Dec 2016 21:00:53 +0100 > Subject: [PATCH 3/3] services: Make nginx service extensible > > * gnu/services/web.scm (nginx-service-type): Make extensible. > (nginx-service): Change default options. > --- > doc/guix.texi | 17 +++++++++++++++-- > gnu/services/web.scm | 34 ++++++++++++++++++++++++++-------- > 2 files changed, 41 insertions(+), 10 deletions(-) Pushed with an adjusted commit log to mention all the changes. http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3Dd338237d8c2408e0cd= 13ecfeb303e327ff7e3d9b > +@deffn {Scheme Variable} nginx-service-type > +This is type for the nginx web server. > + > +This service can be extended to add more vhosts than the default one. > + > +@example > +(simple-service 'my-extra-vhost nginx-service-type > + (list (nginx-vhost-configuration (https-port #f) > + (root "/srv/http/extra-= website")))) > +@end example I also changed =E2=80=9Cvhost=E2=80=9D to =E2=80=9Cserver=E2=80=9D here. Thank you! On a related note: you might have seen the discussion about the =E2=80=98ro= ot=E2=80=99 parameter of server blocks: https://lists.gnu.org/archive/html/help-guix/2017-01/msg00005.html To fix it, we need to have =E2=80=98default-nginx-config=E2=80=99 use =E2= =80=98computed-file=E2=80=99 instead of =E2=80=98plain-file=E2=80=99, and to move have =E2=80=98default-= nginx-server-config=E2=80=99 return a gexp instead of a string. So something like: (define (default-nginx-server-config server) #~(string-append "server {" ;; =E2=80=A6 " root " #$(nginx-server-configuration-root server) ";\n" "};\n")) (define (default-nginx-config =E2=80=A6) (computed-file "nginx.conf" #~(call-with-output-file #$output (lambda (port) (display =E2=80=A6 port))))) That way, people could use (file-append =E2=80=A6) or similar for =E2=80=98= root=E2=80=99 and other parameters that denote a file name. Could you look into it? :-) Ludo=E2=80=99.