GNU bug report logs -
#30702
[PATCH] services: nginx: Support extra content in the http block.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Sun, 4 Mar 2018 20:01:02 UTC
Severity: normal
Tags: patch
Done: Christopher Baines <mail <at> cbaines.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Christopher Baines <mail <at> cbaines.net> skribis:
> Ludovic Courtès <ludo <at> 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’.
This bug report was last modified 7 years and 35 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.