aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/forge/gunicorn.scm22
-rw-r--r--guix/forge/klaus.scm13
2 files changed, 21 insertions, 14 deletions
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))))))