From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exbrm-0001YN-FR for guix-patches@gnu.org; Sun, 18 Mar 2018 13:13:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exbri-0001JA-Cs for guix-patches@gnu.org; Sun, 18 Mar 2018 13:13:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60636) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exbri-0001Iw-8K for guix-patches@gnu.org; Sun, 18 Mar 2018 13:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1exbrh-00023L-U8 for guix-patches@gnu.org; Sun, 18 Mar 2018 13:13:01 -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: <20180304200014.29173-1-mail@cbaines.net> <87h8pel6q6.fsf@gnu.org> <87in9ue046.fsf@cbaines.net> 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> 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: [...] >>> +@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.