aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-10-17 17:25:57 +0530
committerArun Isaac2022-10-17 17:29:20 +0530
commit42c58a43cda934116abfc1e289294383be4be8a7 (patch)
treeb0126573285df8d60668570c8f62545a7120d3d3
parente7e227c774e61cc54ac4a8326a65d4440838cacf (diff)
downloadguix-forge-42c58a43cda934116abfc1e289294383be4be8a7.tar.gz
guix-forge-42c58a43cda934116abfc1e289294383be4be8a7.tar.lz
guix-forge-42c58a43cda934116abfc1e289294383be4be8a7.zip
webhook: Replace lambda function with define function.
* guix/forge/webhook.scm (webhook-shepherd-service): Replace lambda function with define function.
-rw-r--r--guix/forge/webhook.scm65
1 files changed, 32 insertions, 33 deletions
diff --git a/guix/forge/webhook.scm b/guix/forge/webhook.scm
index 7b73de6..9322eb2 100644
--- a/guix/forge/webhook.scm
+++ b/guix/forge/webhook.scm
@@ -173,39 +173,38 @@ Everything else is the responsibility of the command's author.")
(webhook-configuration-hooks config))))
<>)))))
-(define webhook-shepherd-service
- (lambda (config)
- (shepherd-service
- (documentation "Run webhook.")
- (provision '(webhook))
- (requirement '(networking))
- (start
- (let ((hooks-json (computed-file "hooks.json" (hooks-json-gexp config))))
- #~(make-forkexec-constructor
- (list #$(least-authority-wrapper
- (file-append (webhook-configuration-package config)
- "/bin/webhook")
- #:name "webhook"
- #:mappings (list (file-system-mapping
- (source hooks-json)
- (target source))
- (file-system-mapping
- (source (webhook-configuration-log-directory config))
- (target source)
- (writable? #t)))
- ;; TODO: If socket is a Unix socket, run in a
- ;; network namespace. We can't do this yet due to
- ;; https://yhetil.org/guix/m1ilknoi5r.fsf@fastmail.net/
- #:namespaces (delq 'net %namespaces))
- "-hooks" #$hooks-json
- "-ip" #$(forge-ip-socket-ip (webhook-configuration-socket config))
- "-port" #$(number->string (forge-ip-socket-port (webhook-configuration-socket config)))
- "-logfile" #$(string-append (webhook-configuration-log-directory config)
- "/webhook.log"))
- #:user "webhook"
- #:group "webhook"
- #:log-file "/var/log/webhook.log")))
- (stop #~(make-kill-destructor)))))
+(define (webhook-shepherd-service config)
+ (shepherd-service
+ (documentation "Run webhook.")
+ (provision '(webhook))
+ (requirement '(networking))
+ (start
+ (let ((hooks-json (computed-file "hooks.json" (hooks-json-gexp config))))
+ #~(make-forkexec-constructor
+ (list #$(least-authority-wrapper
+ (file-append (webhook-configuration-package config)
+ "/bin/webhook")
+ #:name "webhook"
+ #:mappings (list (file-system-mapping
+ (source hooks-json)
+ (target source))
+ (file-system-mapping
+ (source (webhook-configuration-log-directory config))
+ (target source)
+ (writable? #t)))
+ ;; TODO: If socket is a Unix socket, run in a
+ ;; network namespace. We can't do this yet due to
+ ;; https://yhetil.org/guix/m1ilknoi5r.fsf@fastmail.net/
+ #:namespaces (delq 'net %namespaces))
+ "-hooks" #$hooks-json
+ "-ip" #$(forge-ip-socket-ip (webhook-configuration-socket config))
+ "-port" #$(number->string (forge-ip-socket-port (webhook-configuration-socket config)))
+ "-logfile" #$(string-append (webhook-configuration-log-directory config)
+ "/webhook.log"))
+ #:user "webhook"
+ #:group "webhook"
+ #:log-file "/var/log/webhook.log")))
+ (stop #~(make-kill-destructor))))
(define webhook-service-type
(service-type