1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-27 03:21:49 +02:00

services: Use the new maybe/unset API.

* gnu/home/services/ssh.scm (serialize-address-family): Use the public API of
the maybe infrastructure.
* gnu/services/file-sharing.scm (serialize-maybe-string): Use maybe-value.
(serialize-maybe-file-object): Use maybe-value-set?.
* gnu/services/getmail.scm (getmail-retriever-configuration): Don't use
internals in unset field declarations.
(getmail-destination-configuration): Ditto.
* gnu/services/messaging.scm (raw-content?): Use maybe-value-set?.
(prosody-configuration): Use %unset-value.
* gnu/services/telephony.scm (jami-shepherd-services): Use maybe-value-set?.
(archive-name->username): Use maybe-value-set?.
* tests/services/configuration.scm ("maybe type, no default"): Use
%unset-value.

Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
Attila Lendvai
2022-08-24 14:40:41 +02:00
committed by Maxim Cournoyer
parent cc32cd41f7
commit ee08277a70
8 changed files with 30 additions and 25 deletions
+4 -7
View File
@@ -114,10 +114,7 @@ type generated and used by Transmission clients, suitable for passing to the
;; name-value pair for the JSON builder.
(set! serialize-maybe-string
(lambda (field-name val)
(serialize-string field-name
(if (eq? val 'unset)
""
val))))
(serialize-string field-name (maybe-value val ""))))
(define (string-list? val)
(and (list? val)
@@ -180,9 +177,9 @@ type generated and used by Transmission clients, suitable for passing to the
(define-maybe file-object)
(set! serialize-maybe-file-object
(lambda (field-name val)
(if (eq? val 'unset)
(serialize-string field-name "")
(serialize-file-object field-name val))))
(if (maybe-value-set? val)
(serialize-file-object field-name val)
(serialize-string field-name ""))))
(define (file-object-list? val)
(and (list? val)