aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-12-22 07:59:54 +0000
committerArun Isaac2023-12-22 12:16:10 +0000
commit78ce441925e29acb01e8c98a6133a6e5b917a319 (patch)
treede0a376e7f484bc5efee5856a4bcc26220ec9011
parent6c99c3b28dd7a8b5cf3095a1962bcdc61e9efb67 (diff)
downloadguix-forge-78ce441925e29acb01e8c98a6133a6e5b917a319.tar.gz
guix-forge-78ce441925e29acb01e8c98a6133a6e5b917a319.tar.lz
guix-forge-78ce441925e29acb01e8c98a6133a6e5b917a319.zip
fcgiwrap: Use <environment-variable> records.
* guix/forge/fcgiwrap.scm: Import (forge environment). (fcgiwrap-shepherd-services): Use <environment-variable> record. * doc/forge.skb (Services)[Specialized application deployment services]{fcgiwrap service}: Document it. * guix/forge/cgit.scm: Import (forge environment). (cgit-fcgiwrap-instance): Use <environment-variable> record.
-rw-r--r--doc/forge.skb5
-rw-r--r--guix/forge/cgit.scm5
-rw-r--r--guix/forge/fcgiwrap.scm16
3 files changed, 14 insertions, 12 deletions
diff --git a/doc/forge.skb b/doc/forge.skb
index 13c8430..3dae6f7 100644
--- a/doc/forge.skb
+++ b/doc/forge.skb
@@ -459,8 +459,9 @@ or ,(record-ref "<forge-unix-socket>") object.])
(record-field "processes"
[Number of fcgiwrap 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
diff --git a/guix/forge/cgit.scm b/guix/forge/cgit.scm
index f652825..805f47f 100644
--- a/guix/forge/cgit.scm
+++ b/guix/forge/cgit.scm
@@ -18,6 +18,7 @@
;;; <https://www.gnu.org/licenses/>.
(define-module (forge cgit)
+ #:use-module (forge environment)
#:use-module (forge fcgiwrap)
#:use-module (forge nginx)
#:use-module (forge socket)
@@ -226,7 +227,9 @@ configured in @var{config}."
(name "cgit")
(user "nginx")
(group "nginx")
- (environment-variables `(("CGIT_CONFIG" . ,cgitrc)))
+ (environment-variables (list (environment-variable
+ (name "CGIT_CONFIG")
+ (value cgitrc))))
(mappings (list (file-system-mapping
(source repository-directory)
(target source))
diff --git a/guix/forge/fcgiwrap.scm b/guix/forge/fcgiwrap.scm
index b14bb23..f699480 100644
--- a/guix/forge/fcgiwrap.scm
+++ b/guix/forge/fcgiwrap.scm
@@ -18,6 +18,7 @@
;;; <https://www.gnu.org/licenses/>.
(define-module (forge fcgiwrap)
+ #:use-module (forge environment)
#:use-module (forge socket)
#:use-module (gnu build linux-container)
#:use-module ((gnu packages web) #:select (fcgiwrap))
@@ -129,8 +130,7 @@
;; Additional mappings
mappings)
#:preserved-environment-variables
- (map (match-lambda
- ((variable . value) variable))
+ (map environment-variable-name
environment-variables)
;; TODO: If socket is a Unix socket, run in a
;; network namespace. We can't do this yet due to
@@ -141,13 +141,11 @@
#:user #$user
#:group #$group
#:environment-variables
- (map (match-lambda
- ((variable value)
- (string-append variable "=" value)))
- '#$(map (match-lambda
- ((variable . value)
- (list variable value)))
- environment-variables))
+ (list #$@(map (lambda (variable)
+ #~(string-append #$(environment-variable-name variable)
+ "="
+ #$(environment-variable-value variable)))
+ environment-variables))
#:log-file #$(string-append "/var/log/fcgiwrap/" name ".log")))
(stop #~(make-kill-destructor))))
(fcgiwrap-configuration-instances config)))