mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2025-10-14 01:14:35 +00:00
services: forgejo, grafana: Use serializer from guile-ini.
This commit is contained in:
parent
f35b32e3aa
commit
ae9586b909
@ -4,6 +4,7 @@
|
||||
|
||||
(define-module (rosenthal services monitoring)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils serializers ini)
|
||||
#:use-module (rosenthal utils serializers yaml)
|
||||
@ -137,7 +138,12 @@
|
||||
(match-record-lambda <grafana-configuration>
|
||||
(grafana config shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file
|
||||
(apply mixed-text-file "grafana.ini" (ini-serialize config))))
|
||||
(computed-file "grafana.ini"
|
||||
(with-extensions (list guile-ini guile-lib guile-smc)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini '#$config #:port <>)))))))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(loopback postgresql user-processes
|
||||
|
@ -7,6 +7,7 @@
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix records)
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages guile-xyz)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages video)
|
||||
#:use-module (rosenthal packages binaries)
|
||||
@ -19,6 +20,7 @@
|
||||
#:use-module (gnu services shepherd)
|
||||
#:use-module (gnu system privilege)
|
||||
#:use-module (gnu system shadow)
|
||||
#:use-module (rosenthal utils serializers ini)
|
||||
#:use-module (rosenthal utils serializers yaml)
|
||||
#:export (caddy-configuration
|
||||
caddy-service-type
|
||||
@ -171,10 +173,9 @@ reload its configuration file."))
|
||||
(git-packages
|
||||
(list-of-file-likes (list git git-lfs))
|
||||
"@code{git} and extension packages to install.")
|
||||
(config-file
|
||||
(file-object "/var/lib/forgejo/app.ini")
|
||||
"Filesystem path or file-like object of Forgejo configuration,
|
||||
@file{app.ini}.")
|
||||
(config
|
||||
ini-config
|
||||
"")
|
||||
(no-serialization))
|
||||
|
||||
(define %forgejo-accounts
|
||||
@ -204,7 +205,14 @@ reload its configuration file."))
|
||||
|
||||
(define forgejo-shepherd-service
|
||||
(match-record-lambda <forgejo-configuration>
|
||||
(forgejo config-file)
|
||||
(forgejo config)
|
||||
(let ((config-file
|
||||
(computed-file "forgejo.ini"
|
||||
(with-extensions (list guile-ini guile-lib guile-smc)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini '#$config #:port <>)))))))
|
||||
(list (shepherd-service
|
||||
(documentation "Run Forgejo.")
|
||||
(provision '(forgejo))
|
||||
@ -227,7 +235,7 @@ reload its configuration file."))
|
||||
(stop
|
||||
#~(make-kill-destructor))
|
||||
(actions
|
||||
(list (shepherd-configuration-action config-file)))))))
|
||||
(list (shepherd-configuration-action config-file))))))))
|
||||
|
||||
(define forgejo-service-type
|
||||
(service-type
|
||||
@ -243,7 +251,6 @@ reload its configuration file."))
|
||||
(const forgejo-activation))
|
||||
(service-extension shepherd-root-service-type
|
||||
forgejo-shepherd-service)))
|
||||
(default-value (forgejo-configuration))
|
||||
(description "Run Forgejo.")))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user