From 00014f769233facebd84f13a00b10032a22cb440 Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Sun, 11 Oct 2020 20:42:48 +0300 Subject: services: nginx: Add lua module. * gnu/services/web.scm () [lua-package-path, lua-package-cpath]: New record types. * gnu/services/web.scm (default-nginx-config): Use them. * doc/guix.texi (Web Services): Document this. * doc/guix-cookbook.texi (System Configuration): Document this. --- gnu/services/web.scm | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'gnu/services/web.scm') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index b2d1dcf0ee..a74c6c54b4 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Arun Isaac +;;; Copyright © 2020 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -525,6 +526,10 @@ (define-record-type* (modules nginx-configuration-modules (default '())) (global-directives nginx-configuration-global-directives (default '((events . ())))) + (lua-package-path nginx-lua-package-path ;list of + (default #f)) + (lua-package-cpath nginx-lua-package-cpath ;list of + (default #f)) (extra-content nginx-configuration-extra-content (default "")) (file nginx-configuration-file ;#f | string | file-like @@ -630,6 +635,8 @@ (define (default-nginx-config config) server-names-hash-bucket-max-size modules global-directives + lua-package-path + lua-package-cpath extra-content) (apply mixed-text-file "nginx.conf" (flatten @@ -646,11 +653,19 @@ (define (default-nginx-config config) " scgi_temp_path " run-directory "/scgi_temp;\n" " access_log " log-directory "/access.log;\n" " include " nginx "/share/nginx/conf/mime.types;\n" - (if server-names-hash-bucket-size - (string-append - " server_names_hash_bucket_size " - (number->string server-names-hash-bucket-size) - ";\n") + (if lua-package-path + #~(format #f " lua_package_path ~s;~%" + (string-join (map (lambda (path) + (string-append path "/lib/?.lua")) + '#$lua-package-path) + ";")) + "") + (if lua-package-cpath + #~(format #f " lua_package_cpath ~s;~%" + (string-join (map (lambda (cpath) + (string-append cpath "/lib/lua/?.lua")) + '#$lua-package-cpath) + ";")) "") (if server-names-hash-bucket-max-size (string-append -- cgit v1.2.3