From bf8cd7341a45f2c3de5c40118bb61b95f92f44f8 Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Sat, 15 Jul 2023 23:46:21 +0800 Subject: [PATCH] services: Add cloudflare-warp-service-type. * rosenthal/services/child-error.scm (cloudflare-warp-configuration) (cloudflare-warp-service-type): New variables. --- rosenthal/services/child-error.scm | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/rosenthal/services/child-error.scm b/rosenthal/services/child-error.scm index 1265559..bf6ad1b 100644 --- a/rosenthal/services/child-error.scm +++ b/rosenthal/services/child-error.scm @@ -25,6 +25,9 @@ cloudflare-tunnel-configuration cloudflare-tunnel-service-type + cloudflare-warp-configuration + cloudflare-warp-service-type + miniflux-configuration miniflux-service-type @@ -189,6 +192,39 @@ headers. This can expose sensitive information in your logs.") (default-value (cloudflare-tunnel-configuration)) (description "Run cloudflared, the Cloudflare Tunnel daemon."))) + +;; +;; Cloudflare Warp +;; + + +(define-configuration/no-serialization cloudflare-warp-configuration + (cloudflare-warp + (file-like cloudflare-warp-bin) + "The Cloudflare Warp package.")) + +(define (cloudflare-warp-shepherd-service config) + (match-record config + (cloudflare-warp) + (list (shepherd-service + (documentation "Run warp-svc.") + (provision '(cloudflare-warp)) + (start #~(make-forkexec-constructor + (list #$(file-append cloudflare-warp "/bin/warp-svc")))) + (stop #~(make-kill-destructor)))))) + +(define cloudflare-warp-service-type + (service-type + (name 'cloudflare-warp) + (extensions + (list (service-extension shepherd-root-service-type + cloudflare-warp-shepherd-service) + (service-extension + profile-service-type + (compose list cloudflare-warp-configuration-cloudflare-warp)))) + (default-value (cloudflare-warp-configuration)) + (description "Run warp-svc, the Cloudflare Warp daemon."))) + ;; ;; Miniflux