aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorRichard Sent <richard@freakingpenguin.com>2024-06-20 12:42:03 -0400
committerChristopher Baines <mail@cbaines.net>2024-06-26 15:11:52 +0100
commitda3e71f472c2335f56c3d07758715a514fdb3a9d (patch)
treeb4b6a42c4971291f4e43b03cef080130b079ae08 /gnu/services
parentffdbf1f11ee68e127216cb6682e93b490c7e1d0d (diff)
downloadguix-da3e71f472c2335f56c3d07758715a514fdb3a9d.tar.gz
guix-da3e71f472c2335f56c3d07758715a514fdb3a9d.zip
services: web: Improve nginx formatting for extra-content.
When extra-content is a list, add 4 space indentation and a newline to every line. If it's a string, continue inserting it directly. This makes the list serialization behavior more consistent with other services. * gnu/services/web (default-nginx-config): Support lists. * doc/guix.texi (Web Services)[nginx-configuration]: Document it. Change-Id: Iec8614ba3cfc37292a566197e8d39b352b04846a Signed-off-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/web.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 406117c457..ee3499e5cd 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -771,7 +771,14 @@ of index files."
"\n"
(map emit-nginx-upstream-config upstream-blocks)
(map emit-nginx-server-config server-blocks)
- extra-content
+ (match extra-content
+ ((? list? extra-content)
+ (map (lambda (line)
+ `(" " ,line "\n"))
+ extra-content))
+ ;; XXX: For compatibility strings and gexp's are inserted
+ ;; directly.
+ (_ extra-content))
"\n}\n"))))
(define %nginx-accounts