all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Christopher Baines <mail@cbaines.net>
Cc: 30702@debbugs.gnu.org
Subject: [bug#30702] [PATCH] services: nginx: Support extra content in the http block.
Date: Sun, 18 Mar 2018 18:12:42 +0100	[thread overview]
Message-ID: <87h8pdnw8l.fsf@gnu.org> (raw)
In-Reply-To: <87in9ue046.fsf@cbaines.net> (Christopher Baines's message of "Sat, 17 Mar 2018 23:46:49 +0000")

Christopher Baines <mail@cbaines.net> skribis:

> Ludovic Courtès <ludo@gnu.org> 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’s 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’d have to produce build-side code that will concatenate the strings:

  ;; 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’.

  reply	other threads:[~2018-03-18 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-04 20:00 [bug#30702] [PATCH] services: nginx: Support extra content in the http block Christopher Baines
2018-03-17 21:42 ` Ludovic Courtès
2018-03-17 23:46   ` Christopher Baines
2018-03-18 17:12     ` Ludovic Courtès [this message]
2018-05-18  8:54   ` Christopher Baines
2018-05-19 20:36     ` Ludovic Courtès
2018-06-11 18:09       ` Christopher Baines
2018-06-12  9:09         ` Ludovic Courtès
2018-06-12 20:22           ` bug#30702: " Christopher Baines
2018-05-18  9:37   ` [bug#30702] " Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8pdnw8l.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=30702@debbugs.gnu.org \
    --cc=mail@cbaines.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.