From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: [PATCH] gnu: services: Add nginx-service. Date: Thu, 27 Aug 2015 22:12:18 -0400 Message-ID: References: <873801rqsi.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87io8cmvuz.fsf@gnu.org> <876143f3v4.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]:55190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV99S-00077y-Po for guix-devel@gnu.org; Thu, 27 Aug 2015 22:12:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZV99P-00012F-DF for guix-devel@gnu.org; Thu, 27 Aug 2015 22:12:22 -0400 Received: from mail-yk0-f171.google.com ([209.85.160.171]:34051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZV99P-00011D-4Z for guix-devel@gnu.org; Thu, 27 Aug 2015 22:12:19 -0400 Received: by ykdt205 with SMTP id t205so40658209ykd.1 for ; Thu, 27 Aug 2015 19:12:18 -0700 (PDT) In-Reply-To: <876143f3v4.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 Tue, Aug 25, 2015 at 5:35 PM, Ludovic Court=C3=A8s wrote: > "Thompson, David" skribis: > >> On Tue, Aug 18, 2015 at 11:58 AM, Ludovic Court=C3=A8s wr= ote: >>> "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-dire= ctory))) >>> >>> 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 > > But it just occurred to me that you could write: > > (define (default-nginx-config log-directory run-directory) > (plain-file "nginx.conf" > (string-append ...))) > > Problem solved! Good idea, thanks! I made this change, added a new section to the docs, and pushed. - Dave