From 42c58a43cda934116abfc1e289294383be4be8a7 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 17 Oct 2022 17:25:57 +0530 Subject: webhook: Replace lambda function with define function. * guix/forge/webhook.scm (webhook-shepherd-service): Replace lambda function with define function. --- guix/forge/webhook.scm | 65 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'guix/forge') 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 -- cgit v1.2.3