summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorClément Lassieur <clement@lassieur.org>2018-02-26 01:12:24 +0100
committerClément Lassieur <clement@lassieur.org>2018-03-03 18:21:52 +0100
commitbdcf0e6fd484a54240a98ddf8b6fa433c1b9bd6c (patch)
tree3c7acf5035bd18b09b7c535ed64385af057e1c30 /guix/gexp.scm
parentfb547c3429c32081d68f6f78d7fdfc95a4851348 (diff)
downloadgnu-guix-bdcf0e6fd484a54240a98ddf8b6fa433c1b9bd6c.tar
gnu-guix-bdcf0e6fd484a54240a98ddf8b6fa433c1b9bd6c.tar.gz
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.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index f005c4d296..8dea022e04 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -86,6 +87,7 @@
define-gexp-compiler
gexp-compiler?
+ file-like?
lower-object
lower-inputs
@@ -182,6 +184,11 @@ procedure to lower it; otherwise return #f."
(and=> (hashq-ref %gexp-compilers (struct-vtable object))
gexp-compiler-lower))
+(define (file-like? object)
+ "Return #t if OBJECT leads to a file in the store once unquoted in a
+G-expression; otherwise return #f."
+ (and (struct? object) (->bool (lookup-compiler object))))
+
(define (lookup-expander object)
"Search for an expander for OBJECT. Upon success, return the three argument
procedure to expand it; otherwise return #f."