mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: messaging: Prosody config supports file-like objects.
* doc/guix.texi (Messaging Services): Update accordingly. * gnu/services/configuration.scm (serialize-configuration, serialize-maybe-stem, serialize-package): Return strings or string-valued gexps (these procedures were only used for their side-effects). * gnu/services/messaging.scm (serialize-field, serialize-field-list, enclose-quotes, serialize-raw-content, serialize-ssl-configuration, serialize-virtualhost-configuration-list, serialize-int-component-configuration-list, serialize-ext-component-configuration-list, serialize-virtualhost-configuration, serialize-int-component-configuration, serialize-ext-component-configuration, serialize-prosody-configuration): Return strings or string-valued gexps and stop printing. (prosody-activation): Use SERIALIZE-PROSODY-CONFIGURATION's return value with MIXED-TEXT-FILE instead of using its output with PLAIN-FILE. (serialize-non-negative-integer, serialize-non-negative-integer-list): Convert numbers to strings. (file-object?, serialize-file-object, file-object-list?, serialize-file-object-list): New procedures. (ssl-configuration)[capath, cafile], (prosody-configuration)[plugin-paths, groups-file]: Replace FILE-NAME with FILE-OBJECT. * guix/gexp.scm (file-like?): New exported procedure.
This commit is contained in:
parent
fb547c3429
commit
bdcf0e6fd4
4 changed files with 83 additions and 60 deletions
|
@ -1,7 +1,7 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
|
||||
;;; Copyright © 2017, 2018 Clément Lassieur <clement@lassieur.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -74,11 +74,12 @@
|
|||
(documentation configuration-field-documentation))
|
||||
|
||||
(define (serialize-configuration config fields)
|
||||
(for-each (lambda (field)
|
||||
((configuration-field-serializer field)
|
||||
(configuration-field-name field)
|
||||
((configuration-field-getter field) config)))
|
||||
fields))
|
||||
#~(string-append
|
||||
#$@(map (lambda (field)
|
||||
((configuration-field-serializer field)
|
||||
(configuration-field-name field)
|
||||
((configuration-field-getter field) config)))
|
||||
fields)))
|
||||
|
||||
(define (validate-configuration config fields)
|
||||
(for-each (lambda (field)
|
||||
|
@ -105,7 +106,7 @@
|
|||
(define (maybe-stem? val)
|
||||
(or (eq? val 'disabled) (stem? val)))
|
||||
(define (serialize-maybe-stem field-name val)
|
||||
(when (stem? val) (serialize-stem field-name val)))))))))
|
||||
(if (stem? val) (serialize-stem field-name val) ""))))))))
|
||||
|
||||
(define-syntax define-configuration
|
||||
(lambda (stx)
|
||||
|
@ -147,7 +148,7 @@
|
|||
conf))))))))
|
||||
|
||||
(define (serialize-package field-name val)
|
||||
#f)
|
||||
"")
|
||||
|
||||
;; A little helper to make it easier to document all those fields.
|
||||
(define (generate-documentation documentation documentation-name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue