mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-31 06:46:50 +01:00
services: nginx-upstream-configuration: Allow file-like objects
* gnu/services/web.scm (emit-nginx-upstream-config): Support file-like objects. * doc/guix.texi (Web Services)[nginx-upstream-configuration]: Document it. Change-Id: I49996e358174dc77b31e3c91b908a6a72f3eb705 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
123dcaefe9
commit
ad09bf9638
2 changed files with 14 additions and 3 deletions
|
@ -32342,7 +32342,16 @@ the default port is 80, and a different port can be specified
|
|||
explicitly.
|
||||
|
||||
@item @code{extra-content}
|
||||
A string or list of strings to add to the upstream block.
|
||||
Additional content to be appended to the upstream block. Can be a
|
||||
string or file-like object or list of thereof. In case of list, each
|
||||
item is prefixed with indentation and suffixed with a new line. Nested
|
||||
lists are flattened.
|
||||
|
||||
@lisp
|
||||
(extra-content "include /etc/nginx/custom-config.conf;")
|
||||
(extra-content `("include /etc/nginx/custom-config.conf;"
|
||||
("include " ,%custom-config.conf ";")))
|
||||
@end lisp
|
||||
|
||||
@end table
|
||||
@end deftp
|
||||
|
|
|
@ -704,8 +704,10 @@ (define (emit-nginx-upstream-config upstream)
|
|||
(cons
|
||||
"\n"
|
||||
(map (lambda (line)
|
||||
(simple-format #f " ~A\n" line))
|
||||
(flatten extra-content)))
|
||||
`(" " ,line "\n"))
|
||||
(if (list? extra-content)
|
||||
extra-content
|
||||
(list extra-content))))
|
||||
'()))
|
||||
" }\n"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue