From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: Re: [PATCH] services: nginx: Allow for server extensions. Date: Mon, 7 Dec 2015 14:57:03 -0500 Message-ID: <20151207195703.GB26940@jasmine> References: <874mg2tg7s.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87r3j51dfo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a61uD-0008VR-E0 for guix-devel@gnu.org; Mon, 07 Dec 2015 14:57:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a61uA-0004PO-8K for guix-devel@gnu.org; Mon, 07 Dec 2015 14:57:05 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:43547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a61uA-0004PE-4p for guix-devel@gnu.org; Mon, 07 Dec 2015 14:57:02 -0500 Content-Disposition: inline In-Reply-To: <87r3j51dfo.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: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org On Wed, Dec 02, 2015 at 10:07:23AM +0200, Ludovic Courtès wrote: > David Thompson skribis: > > > Looking for some feedback on my first stab at making the nginx service > > extensible. With this extension mechanism, future web applications > > (such as GNU MediaGoblin) that use nginx as a front-end web server will > > be able to extend nginx with the server configuration that they need in > > order to work. > > Excellent! > > > Here's a useless service that adds nginx configuration to serve the > > contents of /tmp: > > > > (define server > > (plain-file "foo.conf" > > " > > server { > > listen 80; > > root /tmp; > > index index.html; > > server_name dthompson.us; > > } > > ")) > > Do you think it would make sense to provide Scheme bindings for those > ‘server’ configuration snippets, or would we lose too much > expressiveness? I think you might lose too much, although I don't use GuixSD so I don't know if there are other programs that are configured through Scheme bindings. I know that I don't like the Nix bindings for systemd in NixOS. They can't keep up with the pace of development in systemd and provide a limited set of features. > > > From 108db2d183526c42b53060e55f7fb292b53663cb Mon Sep 17 00:00:00 2001 > > From: David Thompson > > Date: Mon, 30 Nov 2015 08:49:08 -0500 > > Subject: [PATCH] services: nginx: Allow for server extensions. > > > > * gnu/services/web.scm ()[servers]: New field. > > (nginx-configuration-servers): New accessor. > > (default-nginx-config): Delete. > > (nginx-configuration-file*): New procedure. > > (nginx-activation): Perform the syntax check on the full computed > > configuration file. > > (nginx-dmd-service): Use the full computed configuration file when > > starting the service. > > (extend-nginx): New procedure. > > (nginx-service-type): Specify extension procedures. > > (nginx-service): Add #:servers argument. > > [...] > > > +(define (nginx-configuration-file* config) > > ‘nginx-configuration->file’ maybe? > > Otherwise LGTM! > > As an exercise, and while waiting for Chris to finish packaging > MediaGoblin ;-), it might make sense to try to use nginx in > ‘guix-publish-service’ or a variant thereof. > > Thank you! > > Ludo’. >