aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/forge.skb5
-rw-r--r--guix/forge/gunicorn.scm22
-rw-r--r--guix/forge/klaus.scm13
3 files changed, 24 insertions, 16 deletions
diff --git a/doc/forge.skb b/doc/forge.skb
index fb9b0bd..13c8430 100644
--- a/doc/forge.skb
+++ b/doc/forge.skb
@@ -491,8 +491,9 @@ describing sockets to listen on])
(record-field "workers"
[Number of worker processes])
(record-field "environment-variables"
- [Association list mapping environment variables that should
-be set in the execution environment to their values])
+ [List of ,(record-ref "<environment-variable>") objects
+describing environment variables that should be set in the execution
+environment])
(record-field "mappings"
[List of ,(code [<file-system-mapping>]) objects describing
additional directories that should be shared with the container
diff --git a/guix/forge/gunicorn.scm b/guix/forge/gunicorn.scm
index 0f7ec91..2e259a7 100644
--- a/guix/forge/gunicorn.scm
+++ b/guix/forge/gunicorn.scm
@@ -18,6 +18,7 @@
;;; <https://www.gnu.org/licenses/>.
(define-module (forge gunicorn)
+ #:use-module (forge environment)
#:use-module (forge socket)
#:use-module (gnu build linux-container)
#:use-module ((gnu packages admin) #:select (shadow))
@@ -179,16 +180,17 @@
;; https://yhetil.org/guix/m1ilknoi5r.fsf@fastmail.net/
#:namespaces (delq 'net %namespaces))
"--workers" #$(number->string (gunicorn-app-workers app))
- '#$(append (append-map (lambda (socket)
- (list "--bind"
- (socket->gunicorn-bind socket)))
- (gunicorn-app-sockets app))
- (append-map (match-lambda
- ((variable . value)
- (list "--env"
- (string-append variable "=" value))))
- (gunicorn-app-environment-variables app))
- (list (gunicorn-app-wsgi-app-module app))))
+ (list #$@(append (append-map (lambda (socket)
+ (list "--bind"
+ (socket->gunicorn-bind socket)))
+ (gunicorn-app-sockets app))
+ (append-map (lambda (variable)
+ (list "--env"
+ #~(string-append #$(environment-variable-name variable)
+ "="
+ #$(environment-variable-value variable))))
+ (gunicorn-app-environment-variables app))
+ (list (gunicorn-app-wsgi-app-module app)))))
#:user #$name
#:group #$name
#:environment-variables
diff --git a/guix/forge/klaus.scm b/guix/forge/klaus.scm
index 5227b74..b6222c3 100644
--- a/guix/forge/klaus.scm
+++ b/guix/forge/klaus.scm
@@ -18,6 +18,7 @@
;;; <https://www.gnu.org/licenses/>.
(define-module (forge klaus)
+ #:use-module (forge environment)
#:use-module (forge gunicorn)
#:use-module (forge socket)
#:use-module ((gnu packages check) #:select (python-nose python-pytest))
@@ -145,10 +146,14 @@ banner."
(package klaus)
(wsgi-app-module "klaus.contrib.wsgi_autoreload")
(sockets sockets)
- (environment-variables `(("KLAUS_REPOS_ROOT" . ,repository-directory)
- ,@(if site-name
- `(("KLAUS_SITE_NAME" . ,site-name))
- '())))
+ (environment-variables (cons (environment-variable
+ (name "KLAUS_REPOS_ROOT")
+ (value repository-directory))
+ (if site-name
+ (list (environment-variable
+ (name "KLAUS_SITE_NAME")
+ (value site-name)))
+ (list))))
(mappings (list (file-system-mapping
(source repository-directory)
(target source))))))