aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorArun Isaac2023-12-22 07:42:57 +0000
committerArun Isaac2023-12-22 12:12:55 +0000
commit6c99c3b28dd7a8b5cf3095a1962bcdc61e9efb67 (patch)
treea03a7d15519dc925a702396c8e3a34ba9fefb91d /guix
parent5fb163738caa16817040da55f09f8a03a95fbe58 (diff)
downloadguix-forge-6c99c3b28dd7a8b5cf3095a1962bcdc61e9efb67.tar.gz
guix-forge-6c99c3b28dd7a8b5cf3095a1962bcdc61e9efb67.tar.lz
guix-forge-6c99c3b28dd7a8b5cf3095a1962bcdc61e9efb67.zip
gunicorn: Use <environment-variable> records.
* guix/forge/gunicorn.scm: Import (forge environment). (gunicorn-shepherd-services): Use <environment-variable> record. * doc/forge.skb (Services)[Specialized application deployment services]{gunicorn service}: Document it. * guix/forge/klaus.scm: Import (forge environment). (klaus-gunicorn-app): Use <environment-variable> record.
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))))))