From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfKW-00040o-Dl for guix-patches@gnu.org; Tue, 12 Jun 2018 05:11:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfKQ-0005PF-CA for guix-patches@gnu.org; Tue, 12 Jun 2018 05:11:08 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36164) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSfKQ-0005P7-78 for guix-patches@gnu.org; Tue, 12 Jun 2018 05:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fSfKQ-0002uf-1y for guix-patches@gnu.org; Tue, 12 Jun 2018 05:11:02 -0400 Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block. Resent-Message-ID: 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> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Christopher Baines Cc: 30702@debbugs.gnu.org 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.