mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
utils: Add toml-file.
* modules/rosenthal/utils/file.scm (toml-file): New procedure. * modules/rosenthal/services/web.scm (conduit-shepherd, iocaine-etc) (navidrome-shepherd-service): Use it.
This commit is contained in:
2 files changed
+41
-26
No files matched your search
@@ -9,12 +9,14 @@
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages guile-xyz)
|
||||
#:use-module (rosenthal packages guile-xyz)
|
||||
#:export (computed-substitution-with-inputs
|
||||
file-content
|
||||
hidden-desktop-entry
|
||||
|
||||
ini-file
|
||||
json-file
|
||||
toml-file
|
||||
yaml-file))
|
||||
|
||||
;; XXX: ‘substitute*’ doesn't fully support Unicode:
|
||||
@@ -80,6 +82,19 @@ format."
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json #$exp <> #:pretty #t))))))
|
||||
|
||||
;; https://github.com/hylophile/guile-toml
|
||||
;; TODO: TOML writing support is incomplete.
|
||||
;; See https://github.com/hylophile/guile-toml/blob/main/toml/builder.scm.
|
||||
(define (toml-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in TOML
|
||||
format."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-json-4 guile-toml)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml #$exp <>))))))
|
||||
|
||||
;; https://gitlab.com/yorgath/guile-yamlpp
|
||||
(define (yaml-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in YAML
|
||||
|
||||
Reference in new issue
Block a user