mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2025-07-05 00:05:22 +00:00
services: Add home-wakapi-service-type.
* rosenthal/services/child-error.scm (home-wakapi-configuration) (home-wakapi-shepherd-service,home-wakapi-service-type): New variables.
This commit is contained in:
parent
8b741c241e
commit
f1d89d66f0
@ -18,7 +18,10 @@
|
|||||||
clash-service-type
|
clash-service-type
|
||||||
|
|
||||||
cloudflare-tunnel-configuration
|
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
|
;; 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.
|
;; 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))))
|
(const %cloudflare-tunnel-accounts))))
|
||||||
(default-value (cloudflare-tunnel-configuration))
|
(default-value (cloudflare-tunnel-configuration))
|
||||||
(description "Run cloudflared, the Cloudflare Tunnel daemon.")))
|
(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…
Reference in New Issue
Block a user