aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/telephony.scm
diff options
context:
space:
mode:
authorBruno Victal <mirai@makinata.eu>2023-10-07 16:59:09 +0100
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-10-07 12:41:06 -0400
commit00a28bc435606dc98925fbae1ebe314881f35c90 (patch)
tree4be9163030bf767f580d9c8dce7a68e3a5b5b18d /gnu/services/telephony.scm
parent3872ecf274ca53a5c195f6b51081474876897565 (diff)
downloadguix-00a28bc435606dc98925fbae1ebe314881f35c90.tar
guix-00a28bc435606dc98925fbae1ebe314881f35c90.tar.gz
services: configuration: Add some commonly used predicates.
* gnu/services/configuration.scm (list-of-packages?, list-of-symbols?): New predicate. * gnu/services/audio.scm (list-of-symbol?): Remove. * gnu/services/telephony.scm (string-list?): Remove. (serialize-string-list): Rename to … (serialize-list-of-strings): … this. (account-fingerprint-list?, jami-account-list?): Use list-of. * doc/guix.texi: Update it. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/services/telephony.scm')
-rw-r--r--gnu/services/telephony.scm20
1 files changed, 7 insertions, 13 deletions
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 56b7772f58..c9b5d6cd99 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -117,15 +117,10 @@
(or (string? val)
(computed-file? val)))
-(define (string-list? val)
- (and (list? val)
- (and-map string? val)))
+(define account-fingerprint-list?
+ (list-of account-fingerprint?))
-(define (account-fingerprint-list? val)
- (and (list? val)
- (and-map account-fingerprint? val)))
-
-(define-maybe string-list)
+(define-maybe list-of-strings)
(define-maybe/no-serialization account-fingerprint-list)
@@ -135,7 +130,7 @@
;;; The following serializers are used to derive an account details alist from
;;; a <jami-account> record.
-(define (serialize-string-list _ val)
+(define (serialize-list-of-strings _ val)
(string-join val ";"))
(define (serialize-boolean _ val)
@@ -188,7 +183,7 @@ maintain communication between devices on such network even when the
connection to the the Internet has been lost. When left unspecified, the
value from the account archive prevails.")
(bootstrap-hostnames
- maybe-string-list
+ maybe-list-of-strings
"A list of hostnames or IPs pointing to OpenDHT nodes, that should be used
to initially join the OpenDHT network. When left unspecified, the value from
the account archive prevails.")
@@ -220,9 +215,8 @@ SET-ACCOUNT-DETAILS."
(list-transduce jami-account-transducer rcons jami-account-fields))
-(define (jami-account-list? val)
- (and (list? val)
- (and-map jami-account? val)))
+(define jami-account-list?
+ (list-of jami-account?))
(define-maybe/no-serialization jami-account-list)