From 6c99c3b28dd7a8b5cf3095a1962bcdc61e9efb67 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 22 Dec 2023 07:42:57 +0000 Subject: gunicorn: Use records. * guix/forge/gunicorn.scm: Import (forge environment). (gunicorn-shepherd-services): Use record. * doc/forge.skb (Services)[Specialized application deployment services]{gunicorn service}: Document it. * guix/forge/klaus.scm: Import (forge environment). (klaus-gunicorn-app): Use record. --- guix/forge/gunicorn.scm | 22 ++++++++++++---------- guix/forge/klaus.scm | 13 +++++++++---- 2 files changed, 21 insertions(+), 14 deletions(-) (limited to 'guix/forge') 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 @@ ;;; . (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 @@ ;;; . (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)))))) -- cgit v1.2.3