services: Add home-wakapi-service-type.

* rosenthal/services/child-error.scm (home-wakapi-configuration)
(home-wakapi-shepherd-service,home-wakapi-service-type): New variables.
remotes/origin/cloudflared-unbundle
Hilton Chain 2 years ago
parent 8b741c241e
commit f1d89d66f0
No known key found for this signature in database
GPG Key ID: 5E5AA665614917F7
  1. 40
      rosenthal/services/child-error.scm

@ -18,7 +18,10 @@
clash-service-type
cloudflare-tunnel-configuration
cloudflare-tunnel-service-type))
cloudflare-tunnel-service-type
home-wakapi-configuration
home-wakapi-service-type))
;; Child-error: services for packages not available in Guix, currently this
;; means some Go and Rust apps I build locally but don't want to package.
@ -188,3 +191,38 @@ headers. This can expose sensitive information in your logs.")
(const %cloudflare-tunnel-accounts))))
(default-value (cloudflare-tunnel-configuration))
(description "Run cloudflared, the Cloudflare Tunnel daemon.")))
;;
;; Wakapi
;;
(define-configuration/no-serialization home-wakapi-configuration
(wakapi
(string "/bin/wakapi")
"The wakapi executable.")
(config
(yaml-config '())
"Association list of Wakapi configurations."))
(define home-wakapi-shepherd-service
(match-lambda
(($ <home-wakapi-configuration> wakapi config)
(let ((config-file (mixed-text-file
"wakapi.yaml"
#~(string-append #$@(serialize-yaml-config config) "\n"))))
(list (shepherd-service
(documentation "Run wakapi.")
(provision '(wakapi))
(start #~(make-forkexec-constructor
(list #$wakapi "-config" #$config-file)))))))))
(define home-wakapi-service-type
(service-type
(name 'home-wakapi)
(extensions
(list (service-extension home-shepherd-service-type
home-wakapi-shepherd-service)))
(default-value (home-wakapi-configuration))
(description "Run Wakapi, a self-hosted WakaTime-compatible backend.")))

Loading…
Cancel
Save