From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esZog-0007rW-Hm for guix-patches@gnu.org; Sun, 04 Mar 2018 15:01:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esZoc-00028c-Lo for guix-patches@gnu.org; Sun, 04 Mar 2018 15:01:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:36823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esZoc-00028Q-IS for guix-patches@gnu.org; Sun, 04 Mar 2018 15:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1esZoc-0005WB-8I for guix-patches@gnu.org; Sun, 04 Mar 2018 15:01:02 -0500 Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esZnw-0007je-QU for guix-patches@gnu.org; Sun, 04 Mar 2018 15:00:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esZns-0001gC-Mn for guix-patches@gnu.org; Sun, 04 Mar 2018 15:00:20 -0500 Received: from li622-129.members.linode.com ([212.71.249.129]:51196 helo=mira.cbaines.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esZns-0001fr-D4 for guix-patches@gnu.org; Sun, 04 Mar 2018 15:00:16 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 4CF9513D064 for ; Sun, 4 Mar 2018 20:00:15 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id a1fb22a1 for ; Sun, 4 Mar 2018 20:00:14 +0000 (UTC) From: Christopher Baines Date: Sun, 4 Mar 2018 20:00:14 +0000 Message-Id: <20180304200014.29173-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30702@debbugs.gnu.org This helpful when adding content to the nginx configuration file, which isn't supported by the record type used for the configuration. For example, like adding proxy_cache_path configuration. * gnu/packages/web.scm (): Add new extra-content field. (nginx-configuration-extra-content): New field accessor. (default-nginx-config): Add support for the extra-content field. * doc/guix.texi (NGINX): Document the new extra-content field. --- doc/guix.texi | 4 ++++ gnu/services/web.scm | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 057272df4..151bc7ddd 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15431,6 +15431,10 @@ use the size of the processors cache line. @item @code{server-names-hash-bucket-max-size} (default: @code{#f}) Maximum bucket size for the server names hash tables. +@item @code{extra-content} (default: @code{'()}) +Extra content for the @code{http} block. Should be a list of strings or +G-expressions. + @end table @end deffn diff --git a/gnu/services/web.scm b/gnu/services/web.scm index beda481b0..1f58c9b86 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -73,6 +73,7 @@ nginx-configuration-upstream-blocks nginx-configuration-server-names-hash-bucket-size nginx-configuration-server-names-hash-bucket-max-size + nginx-configuration-extra-content nginx-configuration-file @@ -423,6 +424,8 @@ (default #f)) (server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size (default #f)) + (extra-content nginx-configuration-extra-content + (default '())) (file nginx-configuration-file ;#f | string | file-like (default #f))) @@ -513,7 +516,8 @@ of index files." (nginx log-directory run-directory server-blocks upstream-blocks server-names-hash-bucket-size - server-names-hash-bucket-max-size) + server-names-hash-bucket-max-size + extra-content) (apply mixed-text-file "nginx.conf" (flatten "user nginx nginx;\n" @@ -542,7 +546,8 @@ of index files." "\n" (map emit-nginx-upstream-config upstream-blocks) (map emit-nginx-server-config server-blocks) - "}\n" + extra-content + "\n}\n" "events {}\n")))) (define %nginx-accounts -- 2.16.0