From d338237d8c2408e0cd13ecfeb303e327ff7e3d9b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 13 Dec 2016 21:00:53 +0100 Subject: services: nginx: Make service extensible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/web.scm ()[server-blocks]: New field. (nginx-activation): When CONFIG-FILE is #f, use 'default-nginx-config'. (nginx-shepherd-service): Likewise. (nginx-service-type): Add 'compose' and 'extend' fields. (nginx-service): Change default value of #:server-list to '(), and default value of #:config-file to #f. * doc/guix.texi (Web Services): Document it. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index fde9601e82..74f1e77e28 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11827,8 +11827,8 @@ The @code{(gnu services web)} module provides the following service: @deffn {Scheme Procedure} nginx-service [#:nginx nginx] @ [#:log-directory ``/var/log/nginx''] @ [#:run-directory ``/var/run/nginx''] @ - [#:server-list (list (nginx-server-configuration))] @ - [#:config-file] + [#:server-list '()] @ + [#:config-file @code{#f}] Return a service that runs @var{nginx}, the nginx web server. @@ -11844,6 +11844,20 @@ this to work, use the default value for @var{config-file}. @end deffn +@deffn {Scheme Variable} nginx-service-type +This is type for the nginx web server. + +This service can be extended to add server blocks in addition to the +default one, as in this example: + +@example +(simple-service 'my-extra-server nginx-service-type + (list (nginx-server-configuration + (https-port #f) + (root "/srv/http/extra-website")))) +@end example +@end deffn + @deftp {Data Type} nginx-server-configuration Data type representing the configuration of an nginx server block. This type has the following parameters: -- cgit v1.2.3