[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/09: services: nginx-upstream-configuration: Allow file-like objects
From: |
guix-commits |
Subject: |
06/09: services: nginx-upstream-configuration: Allow file-like objects |
Date: |
Wed, 20 Nov 2024 17:58:47 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit ad09bf96388acd8302dfd9ed52f8c88464064472
Author: Tomas Volf <~@wolfsden.cz>
AuthorDate: Sun Oct 6 17:22:57 2024 +0200
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>
---
doc/guix.texi | 11 ++++++++++-
gnu/services/web.scm | 6 ++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index f71f0b6561..1c39628ffa 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -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
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 6f77efaaf2..3997fe2ab8 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -704,8 +704,10 @@ of index files."
(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"))
- branch master updated (d5eab53a72 -> b2bd56f8fe), guix-commits, 2024/11/20
- 04/09: gnu: ocaml-sedlex: Update to 3.2., guix-commits, 2024/11/20
- 02/09: gnu: ocaml-sedlex: Use G-Expressions., guix-commits, 2024/11/20
- 06/09: services: nginx-upstream-configuration: Allow file-like objects,
guix-commits <=
- 08/09: gnu: Bump zstd to version 1.5.6, guix-commits, 2024/11/20
- 05/09: services: nginx: Print extra-content before the server-blocks., guix-commits, 2024/11/20
- 03/09: gnu: ocaml-sedlex: Use ucd package., guix-commits, 2024/11/20
- 07/09: gnu: services: power-profiles-daemon: Beautify service., guix-commits, 2024/11/20
- 01/09: home: services: Use %user-log-dir as the log directory for all services., guix-commits, 2024/11/20
- 09/09: gnu: Bump pzstd to version 1.5.6, guix-commits, 2024/11/20