From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: services: Add nginx-service. Date: Tue, 18 Aug 2015 17:58:44 +0200 Message-ID: <87io8cmvuz.fsf@gnu.org> References: <873801rqsi.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> 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]:49966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRjHo-0004JF-OC for guix-devel@gnu.org; Tue, 18 Aug 2015 11:58:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRjHj-0003bo-97 for guix-devel@gnu.org; Tue, 18 Aug 2015 11:58:52 -0400 In-Reply-To: (David Thompson's message of "Mon, 3 Aug 2015 21:48:37 -0400") 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: > From c2da6c04eb1a12d0ee2f56a3954673f3bddc122b Mon Sep 17 00:00:00 2001 > From: David Thompson > Date: Sun, 2 Aug 2015 23:29:53 -0400 > Subject: [PATCH] gnu: services: Add nginx-service. > > * gnu/services/web.scm: New file. > * gnu-system.am (GNU_SYSTEM_MODULES): Add it. [...] > +(define (default-nginx-config log-directory run-directory) > + (text-file* "nginx.conf" > + "user nginx nginx;\n" > + "pid " run-directory "/pid;\n" > + "error_log " log-directory "/error.log info;\n" > + "http {\n" > + " access_log " log-directory "/access.log;\n" > + " root /var/www;\n" > + " server {}\n" > + "}\n" > + "events {}\n")) > + > +(define* (nginx-service #:key (nginx nginx) > + (log-directory "/var/log/nginx") > + (run-directory "/var/run/nginx") > + (config-file > + (default-nginx-config log-directory run-directo= ry))) There=E2=80=99s this annoying thing that here =E2=80=98config-file=E2=80=99= is a monadic value when we=E2=80=99d instead prefer a =E2=80=9Cfile-like object.=E2=80=9D To work around it you could use =E2=80=98plain-file=E2=80=99 and make the d= efault config file independent of the parameters. The obvious issue is that if the user specifies LOG-DIRECTORY or RUN-DIRECTORY different from the default, yet use the default config files, things will break. But maybe that=E2=80=99s an acceptable drawback? Lastly, could you add a =E2=80=9CWeb Services=E2=80=9D section under =E2=80= =9CServices=E2=80=9D in the manual? Thanks! Ludo=E2=80=99.