From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Mar 2018 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 30702@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.152019363021162 (code B ref -1); Sun, 04 Mar 2018 20:01:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Mar 2018 20:00:30 +0000 Received: from localhost ([127.0.0.1]:44720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esZo5-0005VG-Ro for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esZo4-0005V5-PP for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esZny-0001hz-9F for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esZny-0001ht-3o for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:22 -0500 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: by mira.cbaines.net (Postfix, from userid 113) id 8DE3C13D067; Sun, 4 Mar 2018 20:00:15 +0000 (GMT) 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> X-Mailer: git-send-email 2.16.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Mar 2018 21:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.15213229348118 (code B ref 30702); Sat, 17 Mar 2018 21:43:01 +0000 Received: (at 30702) by debbugs.gnu.org; 17 Mar 2018 21:42:14 +0000 Received: from localhost ([127.0.0.1]:38788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exJaf-00026s-UN for submit@debbugs.gnu.org; Sat, 17 Mar 2018 17:42:14 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:49192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exJae-00026l-CB for 30702@debbugs.gnu.org; Sat, 17 Mar 2018 17:42:12 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B614D1326D; Sat, 17 Mar 2018 22:42:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Mxp4odfjjhe; Sat, 17 Mar 2018 22:42:11 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 7938A1326C; Sat, 17 Mar 2018 22:42:10 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180304200014.29173-1-mail@cbaines.net> Date: Sat, 17 Mar 2018 22:42:09 +0100 In-Reply-To: <20180304200014.29173-1-mail@cbaines.net> (Christopher Baines's message of "Sun, 4 Mar 2018 20:00:14 +0000") Message-ID: <87h8pel6q6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello, Christopher Baines skribis: > This helpful when adding content to the nginx configuration file, which i= sn't > supported by the record type used for the configuration. For example, li= ke > adding proxy_cache_path configuration. > > * gnu/packages/web.scm (): Add new extra-content fie= ld. > (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. >=20=20 > +@item @code{extra-content} (default: @code{'()}) > +Extra content for the @code{http} block. Should be a list of strings or > +G-expressions. I find it surprising that it=E2=80=99s a list rather than a string or string-valued gexp. Thoughts? Otherwise I think it=E2=80=99s very useful! Thanks, Ludo=E2=80=99. From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Mar 2018 23:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.15213304152499 (code B ref 30702); Sat, 17 Mar 2018 23:47:02 +0000 Received: (at 30702) by debbugs.gnu.org; 17 Mar 2018 23:46:55 +0000 Received: from localhost ([127.0.0.1]:38859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exLXL-0000eF-H1 for submit@debbugs.gnu.org; Sat, 17 Mar 2018 19:46:55 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:39588 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exLXJ-0000e7-PL for 30702@debbugs.gnu.org; Sat, 17 Mar 2018 19:46:54 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 14B7013D069; Sat, 17 Mar 2018 23:46:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 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 9168C13D064; Sat, 17 Mar 2018 23:46:52 +0000 (GMT) Received: from phact (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 8ca5f44d; Sat, 17 Mar 2018 23:46:52 +0000 (UTC) References: <20180304200014.29173-1-mail@cbaines.net> <87h8pel6q6.fsf@gnu.org> User-agent: mu4e 1.0; emacs 25.3.1 From: Christopher Baines In-reply-to: <87h8pel6q6.fsf@gnu.org> Date: Sat, 17 Mar 2018 23:46:49 +0000 Message-ID: <87in9ue046.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hello, > > Christopher Baines skribis: > >> This helpful when adding content to the nginx configuration file, which = isn't >> supported by the record type used for the configuration. For example, l= ike >> adding proxy_cache_path configuration. >> >> * gnu/packages/web.scm (): Add new extra-content fi= eld. >> (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. > > I find it surprising that it=E2=80=99s a list rather than a string or > string-valued gexp. Thoughts? Lists are used as the type for other fields in related records. I chose a list as it's easy to add things to, but thinking about it, that's probably true for strings and gexps as well. Saying it can be either a string or a gexp might be a little tricky, as string operations wouldn't work on the gexp. My familiarity with string-valued gexps is a little limited though, I've only just started using file-append more, as I think that's how it works. How would you go about adding say a string to a gexp? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlqtqOlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdwWw/9Fyilf/8Dpc04VZTxco20OEiAKS9q/nhWHkTx4lr40u6H7yV3iXDy3xyL t+JXeJJGbRZDNbP0NzJiWfMPRJQsiDxD3UST/W9SsfED1yATvn+eFlotunmj9hw/ //15qljejqbBHZllTMVKnW7fNNVfQKaiyddZrQL7DOI56rav5Gn6VZ10t0K8zthv XKHtFiLBlEiGPwEFIMnXSydJiSaLlsn9ZkJaJjH8+ux7uK3p4Wj4pjhtC34G+26O HoF9WWSjFXAbZb9+ne/GmgoNxtxUsjsS8kfboHTXWMo3WsVYXQ/wfuVKiyvKEhCO ym2oTGWuD5W7/K/CeqVRm2J8qRWK4cndHpS9VcReQ6U/aq6yWRLxd+iauu3EnKCI bOqA0UbBecg17DwpFtrYnwzzWrL4wJYrlKCDr+lIKtl5xFnUeKfLXfFM+D9EuE4I 8hksB9RAje2Lpe2cL0Ba671034h3Qesn5SGjzaGaELo/wqlUmjsWyUCrUqghDNlb iMThvWeUOnd7UllobU3HYNROBbf4RAlFqiKMrLklV1uA5y9Sw2MX9CUs5rznGiM5 3yJ+WCMYjkwWSyR55+Ixi/Y9rEstR2kTKdwAd7bm6F/Lu2m058rp6Qmche4+Jr+3 IPkUfbGTm6ttNQIO0kJnzJB5JznD2eNQXFsnTGAPoEA26vLiw14= =R3Mz -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Mar 2018 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.15213931687872 (code B ref 30702); Sun, 18 Mar 2018 17:13:01 +0000 Received: (at 30702) by debbugs.gnu.org; 18 Mar 2018 17:12:48 +0000 Received: from localhost ([127.0.0.1]:40300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exbrU-00022u-3z for submit@debbugs.gnu.org; Sun, 18 Mar 2018 13:12:48 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:54868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exbrR-00022k-Re for 30702@debbugs.gnu.org; Sun, 18 Mar 2018 13:12:46 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 9DCA512189; Sun, 18 Mar 2018 18:12:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5t2M3olZqs5P; Sun, 18 Mar 2018 18:12:43 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 217E912185; Sun, 18 Mar 2018 18:12:43 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180304200014.29173-1-mail@cbaines.net> <87h8pel6q6.fsf@gnu.org> <87in9ue046.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 28 =?UTF-8?Q?Vent=C3=B4se?= an 226 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 18 Mar 2018 18:12:42 +0100 In-Reply-To: <87in9ue046.fsf@cbaines.net> (Christopher Baines's message of "Sat, 17 Mar 2018 23:46:49 +0000") Message-ID: <87h8pdnw8l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Christopher Baines skribis: > Ludovic Court=C3=A8s writes: [...] >>> +@item @code{extra-content} (default: @code{'()}) >>> +Extra content for the @code{http} block. Should be a list of strings = or >>> +G-expressions. >> >> I find it surprising that it=E2=80=99s a list rather than a string or >> string-valued gexp. Thoughts? > > Lists are used as the type for other fields in related records. I chose > a list as it's easy to add things to, but thinking about it, that's > probably true for strings and gexps as well. > > Saying it can be either a string or a gexp might be a little tricky, as > string operations wouldn't work on the gexp. My familiarity with > string-valued gexps is a little limited though, I've only just started > using file-append more, as I think that's how it works. How would you go > about adding say a string to a gexp? You=E2=80=99d have to produce build-side code that will concatenate the str= ings: ;; Add extra content to CONFIG. (let ((original (nginx-extra-content config))) (nginx-configuration (inherit config) (extra-content #~(string-append #$original "\nextra extra stuff")))) HTH! Ludo=E2=80=99. From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 May 2018 08:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.15266336667259 (code B ref 30702); Fri, 18 May 2018 08:55:02 +0000 Received: (at 30702) by debbugs.gnu.org; 18 May 2018 08:54:26 +0000 Received: from localhost ([127.0.0.1]:39105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJb9d-0001t1-Uv for submit@debbugs.gnu.org; Fri, 18 May 2018 04:54:26 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:38800 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJb9c-0001st-Fh for 30702@debbugs.gnu.org; Fri, 18 May 2018 04:54:25 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id B2B70162C0; Fri, 18 May 2018 09:54:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 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 7DFE01617D for <30702@debbugs.gnu.org>; Fri, 18 May 2018 09:54:23 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 34174801 for <30702@debbugs.gnu.org>; Fri, 18 May 2018 08:54:22 +0000 (UTC) From: Christopher Baines Date: Fri, 18 May 2018 09:54:22 +0100 Message-Id: <20180518085422.15849-1-mail@cbaines.net> X-Mailer: git-send-email 2.17.0 In-Reply-To: <87h8pel6q6.fsf@gnu.org> References: <87h8pel6q6.fsf@gnu.org> X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 a12210db8..eaaf0e684 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15786,6 +15786,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 string or a string +valued G-expression. + @end table @end deffn diff --git a/gnu/services/web.scm b/gnu/services/web.scm index b336a8dd3..8f55dae5e 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.17.0 From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 18 May 2018 09:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.152663626811290 (code B ref 30702); Fri, 18 May 2018 09:38:01 +0000 Received: (at 30702) by debbugs.gnu.org; 18 May 2018 09:37:48 +0000 Received: from localhost ([127.0.0.1]:39138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJbpc-0002w2-0r for submit@debbugs.gnu.org; Fri, 18 May 2018 05:37:48 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:38826 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJbpZ-0002vt-B3 for 30702@debbugs.gnu.org; Fri, 18 May 2018 05:37:46 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 8E524162BD; Fri, 18 May 2018 10:37:44 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 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 1D71716241; Fri, 18 May 2018 10:37:44 +0100 (BST) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 33c7c477; Fri, 18 May 2018 09:37:43 +0000 (UTC) References: <20180304200014.29173-1-mail@cbaines.net> <87h8pel6q6.fsf@gnu.org> User-agent: mu4e 1.0; emacs 25.3.1 From: Christopher Baines In-reply-to: <87h8pel6q6.fsf@gnu.org> Date: Fri, 18 May 2018 10:37:34 +0100 Message-ID: <87muwx484h.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hello, > > Christopher Baines skribis: > >> This helpful when adding content to the nginx configuration file, which = isn't >> supported by the record type used for the configuration. For example, l= ike >> adding proxy_cache_path configuration. >> >> * gnu/packages/web.scm (): Add new extra-content fi= eld. >> (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. > > I find it surprising that it=E2=80=99s a list rather than a string or > string-valued gexp. Thoughts? I've now got around to trying this out, and sent a patch that uses a string, rather than a list. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEERHy+A2M6g58efdvjEhhPDQ1NBccFAlr+nudfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDQ0 N0NCRTAzNjMzQTgzOUYxRTdEREJFMzEyMTg0RjBEMEQ0RDA1QzcACgkQEhhPDQ1N BcfCPA/+NrXZLPuAT+RM+DAXGgQ6TFCY49EUqd+XYKx0Mmtvsf+wh64CdkAWOdaR BqkeAcWf7zNALdo5eM8WZO5l8GH6DrrUFpYBSkJuMZiXtImNhtLwXXQIjLTpn/72 8WBv5zi/RDSHFwdvtVqgWNdFG2zHFLCRre+81v4Ii3gw8xGh8vLucUSRJ/cn4AMQ iHl6i5KK9zmZG6I8zhpE7HfCviXx0ssNSF/FEiXq9erRzyqtMY+abWfKmn5N2fzn o+LdPMU6En/9WsDqaHUCP1xzkPu5YmIY1eMNcvJ0UtZctzBBEDwDbHIwKZ0lRv+d JlMm6wQUSKagl+E6xm5y5OV3BCCkbQcLmz2NX+KUXUTnIkrmngA7H7ylCtSJCYAj ui7Ss63XKIRsLFLVebP0fWxP3U/hwrwS0MtWYYIlNsRZ60PWxXU9Z4QJiQE80iCQ /iPfi5u/bVPQ1CPUzg6ZhJ5AjWZ5SiytZ1Myx8gcvkYKxFh1KHaBKmo+8YvEwZGH UPtrIjN9VuzrPrIdfbrMTzBcC2amyv4leh/sZYvIIGFT2Yl96FVj7+dM8Vms6InS AsfscAWIlMDoNXFXLVNlFcycwyKYM8VaT/oI8hDH091mZAhew7TrQsmXtGa9IUCr 83AoxT1UUjYbHXvGEJkrpA3X5/+d7vS6eSA4mIZpduvYXNRsLXs= =S5Pc -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 May 2018 20:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.15267621962874 (code B ref 30702); Sat, 19 May 2018 20:37:01 +0000 Received: (at 30702) by debbugs.gnu.org; 19 May 2018 20:36:36 +0000 Received: from localhost ([127.0.0.1]:41366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fK8ag-0000kE-LR for submit@debbugs.gnu.org; Sat, 19 May 2018 16:36:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fK8af-0000k3-Se for 30702@debbugs.gnu.org; Sat, 19 May 2018 16:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fK8aa-0002DO-3l for 30702@debbugs.gnu.org; Sat, 19 May 2018 16:36:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fK8aa-0002DF-0s; Sat, 19 May 2018 16:36:28 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37602 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fK8aZ-0005yc-H7; Sat, 19 May 2018 16:36:27 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87h8pel6q6.fsf@gnu.org> <20180518085422.15849-1-mail@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 30 =?UTF-8?Q?Flor=C3=A9al?= an 226 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 19 May 2018 22:36:26 +0200 In-Reply-To: <20180518085422.15849-1-mail@cbaines.net> (Christopher Baines's message of "Fri, 18 May 2018 09:54:22 +0100") Message-ID: <87wovzo01h.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Hello, Christopher Baines skribis: > This helpful when adding content to the nginx configuration file, which i= sn't > supported by the record type used for the configuration. For example, li= ke > adding proxy_cache_path configuration. > > * gnu/packages/web.scm (): Add new extra-content fie= ld. > (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. [...] > +@item @code{extra-content} (default: @code{""}) > +Extra content for the @code{http} block. Should be string or a string > +valued G-expression. [...] > (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")))) That doesn=E2=80=99t work if =E2=80=98extra-content=E2=80=99 is something l= ike: #~(string-append "foo" bar) does it? My understanding of the doc above was that it intends to allow this. But maybe it doesn=E2=80=99t matter after all? Thanks, Ludo=E2=80=99. From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 Jun 2018 18:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.15287405864046 (code B ref 30702); Mon, 11 Jun 2018 18:10:01 +0000 Received: (at 30702) by debbugs.gnu.org; 11 Jun 2018 18:09:46 +0000 Received: from localhost ([127.0.0.1]:43660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSRGD-00013C-OU for submit@debbugs.gnu.org; Mon, 11 Jun 2018 14:09:45 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:56732 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSRGB-000134-Kq for 30702@debbugs.gnu.org; Mon, 11 Jun 2018 14:09:44 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id DCD191646D; Mon, 11 Jun 2018 19:09:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 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 753BF16456; Mon, 11 Jun 2018 19:09:42 +0100 (BST) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 461807e2; Mon, 11 Jun 2018 18:09:42 +0000 (UTC) References: <87h8pel6q6.fsf@gnu.org> <20180518085422.15849-1-mail@cbaines.net> <87wovzo01h.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines In-reply-to: <87wovzo01h.fsf@gnu.org> Date: Mon, 11 Jun 2018 19:09:39 +0100 Message-ID: <8736xt42l8.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hello, > > Christopher Baines skribis: > >> This helpful when adding content to the nginx configuration file, which = isn't >> supported by the record type used for the configuration. For example, l= ike >> adding proxy_cache_path configuration. >> >> * gnu/packages/web.scm (): Add new extra-content fi= eld. >> (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. > > [...] > >> +@item @code{extra-content} (default: @code{""}) >> +Extra content for the @code{http} block. Should be string or a string >> +valued G-expression. > > [...] > >> (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")))) > > That doesn=E2=80=99t work if =E2=80=98extra-content=E2=80=99 is something= like: > > #~(string-append "foo" bar) > > does it? > > My understanding of the doc above was that it intends to allow this. > But maybe it doesn=E2=80=99t matter after all? So... I've finally got back around to looking at this, and as far as I can see, it does work. extra-content is passed as one of the arguments to mixed-text-file, which accepts G-exp things. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlseuuNfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xe2Yw//TqO2XifrzPW/CH2+gZAY2gK78mZz4jLuUlLoYi3i/8gELolsyqsgmshX wp0BYBEonz8Npj7OvV4huslI8QwzwM2RZbT/CsAaUlnWUKK6nD1UHVmhJB7VtsOO niSNAAoKP1k9MTYkaMwj8EL2YBKj69BM4DgFhtcqTxHi+oWvLyl2PtVQMYLpVyFc 3Wlvda9jOENaPainYHApeUil3jjqVgmRQ3ra5dUAaivuMmWDK2lD8Dvf2VnGX+LD 3K0yTmZJmTDKW0YOJXHUlKOjjXWg1rLdGjOML3hZt8cGfDZDJyJszL9Cwy55pOo3 mPPaJascxyht2IR0Z4UsPDT0+x0gDu43ljQI3m3jcd8kk2XAl1lv6T4R/fIcLhuq 6E2zFYDPaYiJHvOUcKyeR/Yvt1ik2iaVjg6yB1sL/PrMzmo3fec6hS+3yDT8pPfO my1psaUOtqcekajyP/m95RDTyd9Ig0TwfQ2QyamnD2Hnm7lwYcx4ZeuOLpe7SM6n mX6wcO17HTEIKJduEJo/PDr/Z4X55oDQv/1fYqFLpP2/NbKo8i6mRYZqsh+b70Lr SVIGUwUizxHGQoWDtMtSJvUZbiMW573q1QjxIQZ0iWZg3sohNbrd7Kk35GMkDMIj f/tXl5rMnaGJIUUq3kP2JgEOg6ZTngJzRxUnj1OyGEZnCzwFhOg= =ohdz -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Aug 14 22:23:25 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 12 Jun 2018 09:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30702 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 30702@debbugs.gnu.org Received: via spool by 30702-submit@debbugs.gnu.org id=B30702.152879461111138 (code B ref 30702); Tue, 12 Jun 2018 09:11:02 +0000 Received: (at 30702) by debbugs.gnu.org; 12 Jun 2018 09:10:11 +0000 Received: from localhost ([127.0.0.1]:44061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSfJa-0002tZ-Oy for submit@debbugs.gnu.org; Tue, 12 Jun 2018 05:10:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39037) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSfJX-0002tA-8f for 30702@debbugs.gnu.org; Tue, 12 Jun 2018 05:10:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfJO-0004ga-1y for 30702@debbugs.gnu.org; Tue, 12 Jun 2018 05:10:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfJN-0004gQ-UD; Tue, 12 Jun 2018 05:09:57 -0400 Received: from nat-eduroam-36-gw-01-bso.bordeaux.inria.fr ([194.199.1.36]:13698 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fSfJN-000071-F3; Tue, 12 Jun 2018 05:09:57 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87h8pel6q6.fsf@gnu.org> <20180518085422.15849-1-mail@cbaines.net> <87wovzo01h.fsf@gnu.org> <8736xt42l8.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 Prairial an 226 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 12 Jun 2018 11:09:55 +0200 In-Reply-To: <8736xt42l8.fsf@cbaines.net> (Christopher Baines's message of "Mon, 11 Jun 2018 19:09:39 +0100") Message-ID: <87y3fkqskc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >> Hello, >> >> Christopher Baines skribis: >> >>> 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 f= ield. >>> (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. >> >> [...] >> >>> +@item @code{extra-content} (default: @code{""}) >>> +Extra content for the @code{http} block. Should be string or a string >>> +valued G-expression. >> >> [...] >> >>> (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")))) >> >> That doesn=E2=80=99t work if =E2=80=98extra-content=E2=80=99 is somethin= g like: >> >> #~(string-append "foo" bar) >> >> does it? >> >> My understanding of the doc above was that it intends to allow this. >> But maybe it doesn=E2=80=99t matter after all? > > So... I've finally got back around to looking at this, and as far as I > can see, it does work. extra-content is passed as one of the arguments > to mixed-text-file, which accepts G-exp things. Alright, sounds good then! Thanks, Ludo=E2=80=99. From unknown Thu Aug 14 22:23:25 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Christopher Baines Subject: bug#30702: closed (Re: [bug#30702] [PATCH] services: nginx: Support extra content in the http block.) Message-ID: References: <87r2lb3gd2.fsf@cbaines.net> <20180304200014.29173-1-mail@cbaines.net> X-Gnu-PR-Message: they-closed 30702 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 30702@debbugs.gnu.org Date: Tue, 12 Jun 2018 20:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1528834982-28531-1" This is a multi-part message in MIME format... ------------=_1528834982-28531-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30702: [PATCH] services: nginx: Support extra content in the http block. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30702@debbugs.gnu.org. --=20 30702: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30702 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1528834982-28531-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30702-done) by debbugs.gnu.org; 12 Jun 2018 20:22:05 +0000 Received: from localhost ([127.0.0.1]:45406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSpnp-0007Ou-CT for submit@debbugs.gnu.org; Tue, 12 Jun 2018 16:22:05 -0400 Received: from li622-129.members.linode.com ([212.71.249.129]:57820 helo=mira.cbaines.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSpnn-0007Om-Er for 30702-done@debbugs.gnu.org; Tue, 12 Jun 2018 16:22:04 -0400 Received: by mira.cbaines.net (Postfix, from userid 113) id 9AC16163BC; Tue, 12 Jun 2018 21:22:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 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 559A61628C; Tue, 12 Jun 2018 21:22:02 +0100 (BST) Received: from giedi (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id ed041c89; Tue, 12 Jun 2018 20:22:02 +0000 (UTC) References: <87h8pel6q6.fsf@gnu.org> <20180518085422.15849-1-mail@cbaines.net> <87wovzo01h.fsf@gnu.org> <8736xt42l8.fsf@cbaines.net> <87y3fkqskc.fsf@gnu.org> User-agent: mu4e 1.0; emacs 26.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. In-reply-to: <87y3fkqskc.fsf@gnu.org> Date: Tue, 12 Jun 2018 21:22:01 +0100 Message-ID: <87r2lb3gd2.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30702-done Cc: 30702-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Alright, sounds good then! Great, I've pushed this patch now :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlsgK2lfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XcSMA//bMkLqVmNtsMm9dwRz+oOvk8KiVhZj++Yvcz7D17mx1XKGX5roTlbgShX BlmH0e2IEl5ZCcx36319QNg/P3yJtPkHUwNYeGOHFvrivS+u0U5qJZfRXjPlQMGr f/OUEx9CSTSd31qmfRCKxZyFhXAymbY+7DhgLUz2fto/h/WpA0h8IUL+8wy6c2tI Xl9R+GPsH6Rlu8WuM57uRbZFxB9fzVwjeSfXyFVlJEr/a2721kxNvk+o1qmdQ0cB ETZqwV1U/GYRhMwi55y2aSYa9xMTVjf7ipSqd3FN+nD+7vaDhtTaCfxG3bPvi8k8 j1e8bMaNukeq0nhEU6qFzViT1e9A2uLsVa8BsO9YFFugMwTGuh6XgOMn3ISfYMPq ikaLgnPim9lu+lVxheYiQlvNtnwwII7G99HT6kgzUNPZ5uqeY6bInI4FQt+1KbLi jAKuxYjYuqUcuAxHM+46j8h22ZPWRxeq2IkpFyZLyzvMb/Iu/GGe64/UuE+RnlVG MQxbejQz0Ywr80d6B16jU/qoGSvCzjIV1rS8zSBuhjjRvo2ZpHh7eGZBjfbmslQL hlMmP//wY0FXAA9CNAheFnkVdF3YfVEft/x7Sb77OTomKOXEqVGB7x7cZA4O/8jV Coy2+MpKdq7Ltlrfvg0xRDv0y5z29CySrIpPjtUoL07UkncaI0g= =Pyt7 -----END PGP SIGNATURE----- --=-=-=-- ------------=_1528834982-28531-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Mar 2018 20:00:30 +0000 Received: from localhost ([127.0.0.1]:44720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esZo5-0005VG-Ro for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1esZo4-0005V5-PP for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esZny-0001hz-9F for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:23 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:38735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esZny-0001ht-3o for submit@debbugs.gnu.org; Sun, 04 Mar 2018 15:00:22 -0500 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: by mira.cbaines.net (Postfix, from userid 113) id 8DE3C13D067; Sun, 4 Mar 2018 20:00:15 +0000 (GMT) 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 To: guix-patches@gnu.org Subject: [PATCH] services: nginx: Support extra content in the http block. Date: Sun, 4 Mar 2018 20:00:14 +0000 Message-Id: <20180304200014.29173-1-mail@cbaines.net> X-Mailer: git-send-email 2.16.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 ------------=_1528834982-28531-1--