GNU bug report logs - #54674
[PATCH] services: configuration: Use *unspecified* instead of 'disabled.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Attila Lendvai <attila@HIDDEN>; Keywords: patch; dated Fri, 1 Apr 2022 19:29:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 17 May 2022 11:40:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 07:40:24 2022
Received: from localhost ([127.0.0.1]:55967 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nqvYt-0005dj-S3
	for submit <at> debbugs.gnu.org; Tue, 17 May 2022 07:40:24 -0400
Received: from mail-ed1-f54.google.com ([209.85.208.54]:40542)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1nqvYs-0005dJ-62
 for 54674 <at> debbugs.gnu.org; Tue, 17 May 2022 07:40:23 -0400
Received: by mail-ed1-f54.google.com with SMTP id i40so7016689eda.7
 for <54674 <at> debbugs.gnu.org>; Tue, 17 May 2022 04:40:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=JUScaQg9hY3R1ZNcMULrXjyQbwkwp4sjLvJPgu8xzVE=;
 b=oWqVa/gRhadm4nIrX/udfDcfyTW8zE1w8V4ltoOHnZIEKLG5lzHD5E5HG9Nx+CcGeO
 WcEeSLt8FPh5nmTH5oRveXK0lZGfhbRlEX8iai7qCkj9ulVSqg52w9DofYSvOjlZPCrr
 gVbdJIwD8Wo58x/PUB16AmEIuiqc7bzmYZGOoqkrxAGmSJ8DQujtv200i0FhsArJDQK8
 Py8EWXW46v23KqD12dsURwznmWH+53SUAt6+py5roE4pVldGuq8KRd6RFCDTkge3fEjM
 rk4aijtGd8ydp/MpLbNXY+nurtleC+qyURV1fZ0cINoOq6HeAPAZIC7JaLU28DfyPC4j
 w7Xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=JUScaQg9hY3R1ZNcMULrXjyQbwkwp4sjLvJPgu8xzVE=;
 b=GWNP8LnPydR48avgX3LUu1i7riNxi3wQE1QVQztH7XcwxVbzJPmzaGldP/aLk5K9MX
 PpdRt+jY0C4xC/wifVIuUy4WcgejQV1I1/TbYG4hdyocgGIjD47HS8OPj13CAu56MTj+
 mrQTkpSG61ZijJSSrd/LFhGtp/lECdfPr5kJ0ERVciHYLEwlnrLhZKa+HpuWaXCdBVnf
 IIWATxYqbCOkYpgLcrV3b1Wswl7mF5DcjxmvjR7OUzGvrArEXZ7jZVHPrJccCEcoExsZ
 hFSN8P3PvpwJjnKbjyi+GjCJD1LhjmCOm+B9dxrQ8AktMQQWY7JJw2gyeLrdMUYPn7ok
 pgHg==
X-Gm-Message-State: AOAM530p7Uif5zwAputK49qajIrUR60Tke+nw5LwuqJRE2ipXDfDj5kW
 mMgXwi1qB48O6Gse2E5XnBJ8O5DO3pM=
X-Google-Smtp-Source: ABdhPJwCyRAuxdrPo4k3LZM/7t/5WCD9NX7K7eq6ByhguAYEIhYYL94nPGrDNSsbMKIjVWxI9p8TLA==
X-Received: by 2002:a05:6402:94a:b0:42a:be9f:6698 with SMTP id
 h10-20020a056402094a00b0042abe9f6698mr6154460edz.393.1652787616166; 
 Tue, 17 May 2022 04:40:16 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 12-20020a17090602cc00b006fe7725ed7dsm9154ejk.34.2022.05.17.04.40.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 17 May 2022 04:40:15 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v5 3/3] doc: Follow the 'disabled -> *unspecified*
 configuration refactor.
Date: Tue, 17 May 2022 13:39:30 +0200
Message-Id: <20220517113926.3931-3-attila@HIDDEN>
X-Mailer: git-send-email 2.35.1
In-Reply-To: <20220517113926.3931-1-attila@HIDDEN>
References: <20220517113926.3931-1-attila@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

---
 doc/guix.texi | 85 ++++++++++++++++++++++++++-------------------------
 1 file changed, 43 insertions(+), 42 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5399584cb0..a578a5bd60 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18632,15 +18632,16 @@ The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the
 @code{:PORT} suffix.  By default, it uses the Jami bootstrap nodes, but
 any host can be specified here.  It's also possible to disable
-bootsrapping by setting this to the @code{'disabled} symbol.
+bootsrapping by explicitly setting this to the @code{*unspecified*}
+value.
 
 Defaults to @samp{"bootstrap.jami.net:4222"}.
 
 @end deftypevr
 
 @deftypevr {@code{opendht-configuration} parameter} maybe-number port
-The UDP port to bind to.  When set to @code{'disabled}, an available
-port is automatically selected.
+The UDP port to bind to.  When explicitly set to @code{*unspecified*},
+an available port is automatically selected.
 
 Defaults to @samp{4222}.
 
@@ -24405,7 +24406,7 @@ The available configuration parameters follow.  Each parameter
 definition is preceded by its type; for example, @samp{string-list foo}
 indicates that the @code{foo} parameter should be specified as a list of
 strings.  Types starting with @code{maybe-} denote parameters that won't
-show up in @code{prosody.cfg.lua} when their value is @code{'disabled}.
+show up in @code{prosody.cfg.lua} when their value is left unspecified.
 
 There is also a way to specify the configuration as a string, if you
 have an old @code{prosody.cfg.lua} file that you want to port over from
@@ -25019,7 +25020,7 @@ Whether to enable debug level messages.
 @item @code{auto-answer?} (default: @code{#f}) (type: boolean)
 Whether to force automatic answer to incoming calls.
 
-@item @code{accounts} (default: @code{disabled}) (type: maybe-jami-account-list)
+@item @code{accounts} (type: maybe-jami-account-list)
 A list of Jami accounts to be (re-)provisioned every time the Jami
 daemon service starts.  When providing this field, the account
 directories under @file{/var/lib/jami/} are recreated every time the
@@ -25041,39 +25042,39 @@ should @emph{not} be encrypted.  It is highly recommended to make it
 readable only to the @samp{root} user (i.e., not in the store), to guard
 against leaking the secret key material of the Jami account it contains.
 
-@item @code{allowed-contacts} (default: @code{disabled}) (type: maybe-account-fingerprint-list)
+@item @code{allowed-contacts} (type: maybe-account-fingerprint-list)
 The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in
-that list will be rejected.  When unspecified, the configuration of the
-account archive is used as-is with respect to contacts and public
+that list will be rejected.  When left specified, the configuration of
+the account archive is used as-is with respect to contacts and public
 inbound calls/messaging allowance, which typically defaults to allow any
 contact to communicate with the account.
 
-@item @code{moderators} (default: @code{disabled}) (type: maybe-account-fingerprint-list)
+@item @code{moderators} (type: maybe-account-fingerprint-list)
 The list of contacts that should have moderation privileges (to ban,
 mute, etc.  other users) in rendezvous conferences, entered as their 40
-characters long fingerprint.  When unspecified, the configuration of the
-account archive is used as-is with respect to moderation, which
+characters long fingerprint.  When left unspecified, the configuration
+of the account archive is used as-is with respect to moderation, which
 typically defaults to allow anyone to moderate.
 
-@item @code{rendezvous-point?} (default: @code{disabled}) (type: maybe-boolean)
+@item @code{rendezvous-point?} (type: maybe-boolean)
 Whether the account should operate in the rendezvous mode.  In this
 mode, all the incoming audio/video calls are mixed into a conference.
 When left unspecified, the value from the account archive prevails.
 
-@item @code{peer-discovery?} (default: @code{disabled}) (type: maybe-boolean)
+@item @code{peer-discovery?} (type: maybe-boolean)
 Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful
 to 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.
 
-@item @code{bootstrap-hostnames} (default: @code{disabled}) (type: maybe-string-list)
+@item @code{bootstrap-hostnames} (type: maybe-string-list)
 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.
 
-@item @code{name-server-uri} (default: @code{disabled}) (type: maybe-string)
+@item @code{name-server-uri} (type: maybe-string)
 The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username.
 
@@ -25707,8 +25708,8 @@ Defaults to @samp{prefer-encrypted-connections}.
 @deftypevr {@code{transmission-daemon-configuration} parameter} maybe-string peer-congestion-algorithm
 The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt}.  When left unspecified, the operating-system default
+is used.
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -29336,7 +29337,7 @@ Defaults to @samp{tun}.
 
 If you do not have some of these files (eg.@: you use a username and
 password), you can disable any of the following three fields by setting
-it to @code{'disabled}.
+it to @code{*unspecified*}.
 
 @deftypevr {@code{openvpn-client-configuration} parameter} maybe-string ca
 The certificate authority to check connections against.
@@ -29410,7 +29411,6 @@ Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.
 
-Defaults to @samp{'disabled}.
 @end deftypevr
 
 @deftypevr {@code{openvpn-client-configuration} parameter} key-usage verify-key-usage?
@@ -29491,7 +29491,7 @@ Defaults to @samp{tun}.
 
 If you do not have some of these files (eg.@: you use a username and
 password), you can disable any of the following three fields by setting
-it to @code{'disabled}.
+it to @code{*unspecified*}.
 
 @deftypevr {@code{openvpn-server-configuration} parameter} maybe-string ca
 The certificate authority to check connections against.
@@ -30290,10 +30290,10 @@ content by adding a valid @code{tlp-configuration}:
 @end deffn
 
 Each parameter definition is preceded by its type; for example,
-@samp{boolean foo} indicates that the @code{foo} parameter
-should be specified as a boolean.  Types starting with
-@code{maybe-} denote parameters that won't show up in TLP config file
-when their value is @code{'disabled}.
+@samp{boolean foo} indicates that the @code{foo} parameter should be
+specified as a boolean.  Types starting with @code{maybe-} denote
+parameters that won't show up in TLP config file when their value is
+left unset, or is explicitly set to the @code{*unspecified*} value.
 
 @c The following documentation was initially generated by
 @c (generate-tlp-documentation) in (gnu services pm).  Manually maintained
@@ -37853,15 +37853,16 @@ macro which is a shorthand of this.
 @deffn {Scheme Syntax} define-maybe @var{type}
 Sometimes a field should not be serialized if the user doesn’t specify a
 value.  To achieve this, you can use the @code{define-maybe} macro to
-define a ``maybe type''; if the value of a maybe type is set to the
-@code{disabled}, it will not be serialized.
+define a ``maybe type''; if the value of a maybe type is left unset, or
+is set to the @code{*unspecified*} value, then it will not be
+serialized.
 
 When defining a ``maybe type'', the corresponding serializer for the
 regular type will be used by default.  For example, a field of type
 @code{maybe-string} will be serialized using the @code{serialize-string}
 procedure by default, you can of course change this by specifying a
 custom serializer procedure.  Likewise, the type of the value would have
-to be a string, unless it is set to the @code{disabled} symbol.
+to be a string, or left unspecified.
 
 @lisp
 (define-maybe string)
@@ -37871,9 +37872,9 @@ to be a string, unless it is set to the @code{disabled} symbol.
 
 (define-configuration baz-configuration
   (name
-   ;; Nothing will be serialized by default.  If set to a string, the
-   ;; `serialize-string' procedure will be used to serialize the string.
-   (maybe-string 'disabled)
+   ;; If set to a string, the `serialize-string' procedure will be used
+   ;; to serialize the string.  Otherwise this field is not serialized.
+   maybe-string    ; equivalent to (maybe-string *unspecified*)
    "The name of this module."))
 @end lisp
 
@@ -37890,7 +37891,7 @@ serializer name by using the @code{prefix} literal.
 
 There is also the @code{no-serialization} literal, which when set means
 that no serializer will be defined for the ``maybe type'', regardless of
-its value is @code{disabled} or not.
+whether its value is set or not.
 @code{define-maybe/no-serialization} is a shorthand for specifying the
 @code{no-serialization} literal.
 
@@ -37899,7 +37900,7 @@ its value is @code{disabled} or not.
 
 (define-configuration/no-serialization test-configuration
   (mode
-   (maybe-symbol 'disabled)
+   maybe-symbol
    "Docstring."))
 @end lisp
 @end deffn
@@ -38031,10 +38032,10 @@ Below is an example of a record type created using
    "The name of the contact."
    serialize-contact-name)
   (phone-number
-   (maybe-integer 'disabled)
+   maybe-integer
    "The person's phone number.")
   (email
-   (maybe-string 'disabled)
+   maybe-string
    "The person's email address.")
   (married?
    (boolean)
@@ -38758,24 +38759,24 @@ Daytime color temperature (kelvins).
 @item @code{nighttime-temperature} (default: @code{4500}) (type: integer)
 Nighttime color temperature (kelvins).
 
-@item @code{daytime-brightness} (default: @code{disabled}) (type: maybe-inexact-number)
-Daytime screen brightness, between 0.1 and 1.0.
+@item @code{daytime-brightness} (type: maybe-inexact-number)
+Daytime screen brightness, between 0.1 and 1.0, or left unspecified.
 
-@item @code{nighttime-brightness} (default: @code{disabled}) (type: maybe-inexact-number)
-Nighttime screen brightness, between 0.1 and 1.0.
+@item @code{nighttime-brightness} (type: maybe-inexact-number)
+Nighttime screen brightness, between 0.1 and 1.0, or left unspecified.
 
-@item @code{latitude} (default: @code{disabled}) (type: maybe-inexact-number)
+@item @code{latitude} (type: maybe-inexact-number)
 Latitude, when @code{location-provider} is @code{'manual}.
 
-@item @code{longitude} (default: @code{disabled}) (type: maybe-inexact-number)
+@item @code{longitude} (type: maybe-inexact-number)
 Longitude, when @code{location-provider} is @code{'manual}.
 
-@item @code{dawn-time} (default: @code{disabled}) (type: maybe-string)
+@item @code{dawn-time} (type: maybe-string)
 Custom time for the transition from night to day in the
 morning---@code{"HH:MM"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.
 
-@item @code{dusk-time} (default: @code{disabled}) (type: maybe-string)
+@item @code{dusk-time} (type: maybe-string)
 Likewise, custom time for the transition from day to night in the
 evening.
 
-- 
2.35.1





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 17 May 2022 11:40:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 07:40:20 2022
Received: from localhost ([127.0.0.1]:55964 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nqvYp-0005dS-0v
	for submit <at> debbugs.gnu.org; Tue, 17 May 2022 07:40:20 -0400
Received: from mail-ej1-f46.google.com ([209.85.218.46]:44733)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1nqvYl-0005d5-EY
 for 54674 <at> debbugs.gnu.org; Tue, 17 May 2022 07:40:17 -0400
Received: by mail-ej1-f46.google.com with SMTP id i19so34084997eja.11
 for <54674 <at> debbugs.gnu.org>; Tue, 17 May 2022 04:40:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=8CrEs7gdklCpiaA3AyH4fasyI6Aem3+sfHHu2S7iSew=;
 b=JiQ0uYpXNFUDsJMhcUDF469mDiu9bJoVZ7kZa8Zl4v6J3vAIEFrya55/efB+XFZx6B
 2feTkQXms8C58yV+0ggZLACmyOdj/V+AS5SYQoNShi8/4oX91PZx5dXscIkL6XB4rUpo
 5ahdw4nW9Gjos63n3X+dYp32g3PTDDnutYHUEA9GuU7vrHG70ABrbJ5sinHZDKLyhScu
 y+cIkj55Xx/3/ZvUsPRMadpab/O9GrYNM3SCVVbSNAL9XCv4xB37gN2Ac2EXtm75FQWa
 Y5mqcoAhFoMNrpmwq/FesICGi+Y+GAdylDHEnnpi3+hKPixO3IFop5wUkbJcxdSASoAT
 P6yQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=8CrEs7gdklCpiaA3AyH4fasyI6Aem3+sfHHu2S7iSew=;
 b=iiEGjgZw9pzmvdHyTMXVR5TsrC2jr2ofzihSTqgBxq8CTbytWzmoOhPiMbBQa2ZPga
 Ybosz56BmxeJqfS+NSYSQyzwvp8lqAl/4LqNGMqFMdOD0ivNfFgb+jvBvRgeC8VUjRaC
 C7O4MXuTeII+F/oHnci9nPAVab/iXfuF4C7ECbFb12DW7MnNDwNtF+6MDwP6GW+tZheW
 XsAK2K7jJPUfL8ZnmmFo4VYxrbykeiaQjqCYtQLgIuI6HjBvBunJ0Y73R9G031rT2vec
 2qTU8tiQ3hi+mqSdCSCtEPx5x5P/1j48zZn7eX09wGD5rRcNa1EEaAz4/pEVx1KYFIts
 8bPA==
X-Gm-Message-State: AOAM5313VrX85cClRizpDXeuOvF8nQ4CLrBoH0s36wBj+cqb15UJNlBr
 ZYt5ExvFQKHrdQ2cB/AwnrEVg5J1CwQ=
X-Google-Smtp-Source: ABdhPJyjypIO/K7uKJXJJvSJL0UevnEffFhFbovCwig/MXElP+Fx70H69NFczC1J1A76W05ilhn6AQ==
X-Received: by 2002:a17:907:8a16:b0:6fe:49b5:350b with SMTP id
 sc22-20020a1709078a1600b006fe49b5350bmr7058183ejc.610.1652787609180; 
 Tue, 17 May 2022 04:40:09 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 12-20020a17090602cc00b006fe7725ed7dsm9154ejk.34.2022.05.17.04.40.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 17 May 2022 04:40:08 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v5 2/3] services: configuration: Use *unspecified* instead of
 'disabled.
Date: Tue, 17 May 2022 13:39:28 +0200
Message-Id: <20220517113926.3931-2-attila@HIDDEN>
X-Mailer: git-send-email 2.35.1
In-Reply-To: <20220517113926.3931-1-attila@HIDDEN>
References: <20220517113926.3931-1-attila@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Use *unspecified* as a marker for field values that have not been set.

Rationale: 'disabled may easily clash with user values for boolean fields, is
confusing (i.e. its meaning is *not* boolean false, but unspecified) and it
also passes silently through the symbol? predicate of a field of type symbol.

* gnu/services/configuration.scm (configuration-missing-default-value):
Renamed from configuration-no-default-value.
* gnu/services/configuration.scm (define-maybe-helper): Use *unspecified*
instead of 'disabled, and make the default value optional.
* tests/services/configuration.scm ("maybe type, no default")
("maybe type, with default"): New tests.
---
 gnu/home/services/desktop.scm    | 12 ++---
 gnu/services/authentication.scm  | 82 ++++++++++++++++----------------
 gnu/services/cgit.scm            | 12 ++---
 gnu/services/configuration.scm   | 17 ++++---
 gnu/services/file-sharing.scm    | 24 +++++-----
 gnu/services/messaging.scm       | 37 +++++++-------
 gnu/services/networking.scm      | 12 ++---
 gnu/services/pm.scm              | 54 ++++++++++-----------
 gnu/services/telephony.scm       | 22 ++++-----
 gnu/services/vpn.scm             |  2 +-
 tests/services/configuration.scm | 12 +++++
 11 files changed, 148 insertions(+), 138 deletions(-)

diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm
index cbb9cf76da..b0f4d969b0 100644
--- a/gnu/home/services/desktop.scm
+++ b/gnu/home/services/desktop.scm
@@ -91,26 +91,26 @@ (define-configuration home-redshift-configuration
    "Nighttime color temperature (kelvins).")
 
   (daytime-brightness
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Daytime screen brightness, between 0.1 and 1.0.")
   (nighttime-brightness
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Nighttime screen brightness, between 0.1 and 1.0.")
 
   (latitude
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Latitude, when @code{location-provider} is @code{'manual}.")
   (longitude
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Longitude, when @code{location-provider} is @code{'manual}.")
 
   (dawn-time
-   (maybe-string 'disabled)
+   maybe-string
    "Custom time for the transition from night to day in the
 morning---@code{\"HH:MM\"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.")
   (dusk-time
-   (maybe-string 'disabled)
+   maybe-string
    "Likewise, custom time for the transition from day to night in the
 evening.")
 
diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm
index cb0ef6d85a..f7becdfafb 100644
--- a/gnu/services/authentication.scm
+++ b/gnu/services/authentication.scm
@@ -218,7 +218,7 @@ (define-configuration nslcd-configuration
 
   ;; Runtime options
   (threads
-   (maybe-number 'disabled)
+   maybe-number
    "The number of threads to start that can handle requests and perform LDAP
 queries.  Each thread opens a separate connection to the LDAP server.  The
 default is to start 5 threads.")
@@ -243,45 +243,45 @@ (define-configuration nslcd-configuration
    "The list of LDAP server URIs.  Normally, only the first server will be
 used with the following servers as fall-back.")
   (ldap-version
-   (maybe-string 'disabled)
+   maybe-string
    "The version of the LDAP protocol to use.  The default is to use the
 maximum version supported by the LDAP library.")
   (binddn
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the distinguished name with which to bind to the directory
 server for lookups.  The default is to bind anonymously.")
   (bindpw
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the credentials with which to bind.  This option is only
 applicable when used with binddn.")
   (rootpwmoddn
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the distinguished name to use when the root user tries to modify
 a user's password using the PAM module.")
   (rootpwmodpw
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the credentials with which to bind if the root user tries to
 change a user's password.  This option is only applicable when used with
 rootpwmoddn")
 
   ;; SASL authentication options
   (sasl-mech
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the SASL mechanism to be used when performing SASL
 authentication.")
   (sasl-realm
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the SASL realm to be used when performing SASL authentication.")
   (sasl-authcid
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the authentication identity to be used when performing SASL
 authentication.")
   (sasl-authzid
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the authorization identity to be used when performing SASL
 authentication.")
   (sasl-canonicalize?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Determines whether the LDAP server host name should be canonicalised.  If
 this is enabled the LDAP library will do a reverse host name lookup.  By
 default, it is left up to the LDAP library whether this check is performed or
@@ -289,7 +289,7 @@ (define-configuration nslcd-configuration
 
   ;; Kerberos authentication options
   (krb5-ccname
-   (maybe-string 'disabled)
+   maybe-string
    "Set the name for the GSS-API Kerberos credentials cache.")
 
   ;; Search / mapping options
@@ -302,11 +302,11 @@ (define-configuration nslcd-configuration
 default scope is subtree; base scope is almost never useful for name service
 lookups; children scope is not supported on all servers.")
   (deref
-   (maybe-deref-option 'disabled)
+   maybe-deref-option
    "Specifies the policy for dereferencing aliases.  The default policy is to
 never dereference aliases.")
   (referrals
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Specifies whether automatic referral chasing should be enabled.  The
 default behaviour is to chase referrals.")
   (maps
@@ -322,132 +322,132 @@ (define-configuration nslcd-configuration
 
   ;; Timing / reconnect options
   (bind-timelimit
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the time limit in seconds to use when connecting to the
 directory server.  The default value is 10 seconds.")
   (timelimit
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the time limit (in seconds) to wait for a response from the LDAP
 server.  A value of zero, which is the default, is to wait indefinitely for
 searches to be completed.")
   (idle-timelimit
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the period if inactivity (in seconds) after which the con‐
 nection to the LDAP server will be closed.  The default is not to time out
 connections.")
   (reconnect-sleeptime
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the number of seconds to sleep when connecting to all LDAP
 servers fails.  By default one second is waited between the first failure and
 the first retry.")
   (reconnect-retrytime
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the time after which the LDAP server is considered to be
 permanently unavailable.  Once this time is reached retries will be done only
 once per this time period.  The default value is 10 seconds.")
 
   ;; TLS options
   (ssl
-   (maybe-ssl-option 'disabled)
+   maybe-ssl-option
    "Specifies whether to use SSL/TLS or not (the default is not to).  If
 'start-tls is specified then StartTLS is used rather than raw LDAP over SSL.")
   (tls-reqcert
-   (maybe-tls-reqcert-option 'disabled)
+   maybe-tls-reqcert-option
    "Specifies what checks to perform on a server-supplied certificate.
 The meaning of the values is described in the ldap.conf(5) manual page.")
   (tls-cacertdir
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the directory containing X.509 certificates for peer authen‐
 tication.  This parameter is ignored when using GnuTLS.")
   (tls-cacertfile
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to the X.509 certificate for peer authentication.")
   (tls-randfile
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to an entropy source.  This parameter is ignored when
 using GnuTLS.")
   (tls-ciphers
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the ciphers to use for TLS as a string.")
   (tls-cert
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to the file containing the local certificate for client
 TLS authentication.")
   (tls-key
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to the file containing the private key for client TLS
 authentication.")
 
   ;; Other options
   (pagesize
-   (maybe-number 'disabled)
+   maybe-number
    "Set this to a number greater than 0 to request paged results from the LDAP
 server in accordance with RFC2696.  The default (0) is to not request paged
 results.")
   (nss-initgroups-ignoreusers
-   (maybe-ignore-users-option 'disabled)
+   maybe-ignore-users-option
    "This option prevents group membership lookups through LDAP for the
 specified users.  Alternatively, the value 'all-local may be used.  With that
 value nslcd builds a full list of non-LDAP users on startup.")
   (nss-min-uid
-   (maybe-number 'disabled)
+   maybe-number
    "This option ensures that LDAP users with a numeric user id lower than the
 specified value are ignored.")
   (nss-uid-offset
-   (maybe-number 'disabled)
+   maybe-number
    "This option specifies an offset that is added to all LDAP numeric user
 ids.  This can be used to avoid user id collisions with local users.")
   (nss-gid-offset
-   (maybe-number 'disabled)
+   maybe-number
    "This option specifies an offset that is added to all LDAP numeric group
 ids.  This can be used to avoid user id collisions with local groups.")
   (nss-nested-groups
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "If this option is set, the member attribute of a group may point to
 another group.  Members of nested groups are also returned in the higher level
 group and parent groups are returned when finding groups for a specific user.
 The default is not to perform extra searches for nested groups.")
   (nss-getgrent-skipmembers
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "If this option is set, the group member list is not retrieved when looking
 up groups.  Lookups for finding which groups a user belongs to will remain
 functional so the user will likely still get the correct groups assigned on
 login.")
   (nss-disable-enumeration
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "If this option is set, functions which cause all user/group entries to be
 loaded from the directory will not succeed in doing so.  This can dramatically
 reduce LDAP server load in situations where there are a great number of users
 and/or groups.  This option is not recommended for most configurations.")
   (validnames
-   (maybe-string 'disabled)
+   maybe-string
    "This option can be used to specify how user and group names are verified
 within the system.  This pattern is used to check all user and group names
 that are requested and returned from LDAP.")
   (ignorecase
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "This specifies whether or not to perform searches using case-insensitive
 matching.  Enabling this could open up the system to authorization bypass
 vulnerabilities and introduce nscd cache poisoning vulnerabilities which allow
 denial of service.")
   (pam-authc-ppolicy
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "This option specifies whether password policy controls are requested and
 handled from the LDAP server when performing user authentication.")
   (pam-authc-search
-   (maybe-string 'disabled)
+   maybe-string
    "By default nslcd performs an LDAP search with the user's credentials after
 BIND (authentication) to ensure that the BIND operation was successful.  The
 default search is a simple check to see if the user's DN exists.  A search
 filter can be specified that will be used instead.  It should return at least
 one entry.")
   (pam-authz-search
-   (maybe-string 'disabled)
+   maybe-string
    "This option allows flexible fine tuning of the authorisation check that
 should be performed.  The search filter specified is executed and if any
 entries match, access is granted, otherwise access is denied.")
   (pam-password-prohibit-message
-   (maybe-string 'disabled)
+   maybe-string
    "If this option is set password modification using pam_ldap will be denied
 and the specified message will be presented to the user instead.  The message
 can be used to direct the user to an alternative means of changing their
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bfc89a40a4..c2c003983a 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -241,27 +241,27 @@ (define-configuration repository-cgit-configuration
    (repo-file-object "")
    "Override the default @code{email-filter}.")
   (enable-commit-graph?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.")
   (enable-log-filecount?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.")
   (enable-log-linecount?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.")
   (enable-remote-branches?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.")
   (enable-subject-links?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to override the global setting
 @code{enable-subject-links?}.")
   (enable-html-serving?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to override the global setting
 @code{enable-html-serving?}.")
   (hide?
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index bdca33ed68..f6b20fb82b 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -93,7 +93,7 @@ (define (configuration-field-error field val)
 (define (configuration-missing-field kind field)
   (configuration-error
    (format #f "~a configuration missing required field ~a" kind field)))
-(define (configuration-no-default-value kind field)
+(define (configuration-missing-default-value kind field)
   (configuration-error
    (format #f "The field `~a' of the `~a' configuration record \
 does not have a default value" field kind)))
@@ -142,7 +142,8 @@ (define (define-maybe-helper serialize? prefix syn)
                                     (id #'stem #'serialize-maybe- #'stem))))
        #`(begin
            (define (maybe-stem? val)
-             (or (eq? val 'disabled) (stem? val)))
+             (or (unspecified? val)
+                 (stem? val)))
            #,@(if serialize?
                   (list #'(define (serialize-maybe-stem field-name val)
                             (if (stem? val)
@@ -170,10 +171,10 @@ (define (normalize-field-type+def s)
      (values #'(field-type def)))
     ((field-type)
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))
+     (values #'(field-type *unspecified*)))
     (field-type
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))))
+     (values #'(field-type *unspecified*)))))
 
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
@@ -219,9 +220,7 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
                                           source-properties->location))
                           (innate))
                #,@(map (lambda (name getter def)
-                         (if (eq? (syntax->datum def) (quote 'undefined))
-                             #`(#,name #,getter)
-                             #`(#,name #,getter (default #,def))))
+                         #`(#,name #,getter (default #,def)))
                        #'(field ...)
                        #'(field-getter ...)
                        #'(field-default ...)))
@@ -236,8 +235,8 @@ (define #,(id #'stem #'stem #'-fields)
                         (lambda ()
                           (display '#,(id #'stem #'% #'stem))
                           (if (eq? (syntax->datum field-default)
-                                   'undefined)
-                              (configuration-no-default-value
+                                   '*unspecified*)
+                              (configuration-missing-default-value
                                '#,(id #'stem #'% #'stem) 'field)
                               field-default)))
                       (documentation doc))
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index e3d681b08f..e32d1f145d 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -115,8 +115,7 @@ (define-maybe string)
 (set! serialize-maybe-string
   (lambda (field-name val)
     (serialize-string field-name
-                      (if (and (symbol? val)
-                               (eq? val 'disabled))
+                      (if (unspecified? val)
                           ""
                           val))))
 
@@ -181,8 +180,7 @@ (define (serialize-file-object field-name val)
 (define-maybe file-object)
 (set! serialize-maybe-file-object
   (lambda (field-name val)
-    (if (and (symbol? val)
-             (eq? val 'disabled))
+    (if (unspecified? val)
         (serialize-string field-name "")
         (serialize-file-object field-name val))))
 
@@ -281,7 +279,7 @@ (define-configuration transmission-daemon-configuration
 torrent is complete.  Otherwise, files for all torrents (including those still
 being downloaded) will be placed in @code{download-dir}.")
   (incomplete-dir
-   (maybe-string 'disabled)
+   maybe-string
    "The directory in which files from incompletely downloaded torrents will be
 held when @code{incomplete-dir-enabled?} is @code{#t}.")
   (umask
@@ -305,7 +303,7 @@ (define-configuration transmission-daemon-configuration
 automatically (and the original files removed, if
 @code{trash-original-torrent-files?} is @code{#t}).")
   (watch-dir
-   (maybe-string 'disabled)
+   maybe-string
    "The directory to be watched for @file{.torrent} files indicating new
 torrents to be added, when @code{watch-dir-enabled} is @code{#t}.")
   (trash-original-torrent-files?
@@ -401,11 +399,11 @@ (define-configuration transmission-daemon-configuration
 @code{prefer-unencrypted-connections}, @code{prefer-encrypted-connections} or
 @code{require-encrypted-connections}.")
   (peer-congestion-algorithm
-   (maybe-string 'disabled)
+   maybe-string
    "The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt} (or leave it unset, in which case the operating-system
+default is used).
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -465,7 +463,7 @@ (define-configuration transmission-daemon-configuration
    "When @code{#t}, the daemon will ignore peers mentioned in the blocklist it
 has most recently downloaded from @code{blocklist-url}.")
   (blocklist-url
-   (maybe-string 'disabled)
+   maybe-string
    "The URL of a peer blocklist (in @acronym{P2P}-plaintext or eMule
 @file{.dat} format) to be periodically downloaded and applied when
 @code{blocklist-enabled?} is @code{#t}.")
@@ -564,11 +562,11 @@ (define-configuration transmission-daemon-configuration
 the side effect of disabling host-name whitelisting (see
 @code{rpc-host-whitelist-enabled?}.")
   (rpc-username
-   (maybe-string 'disabled)
+   maybe-string
    "The username required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.")
   (rpc-password
-   (maybe-transmission-password-hash 'disabled)
+   maybe-transmission-password-hash
    "The password required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.  This must be specified
 using a password hash in the format recognized by Transmission clients, either
@@ -613,7 +611,7 @@ (define-configuration transmission-daemon-configuration
 @code{script-torrent-done-filename} will be invoked each time a torrent
 completes.")
   (script-torrent-done-filename
-   (maybe-file-object 'disabled)
+   maybe-file-object
    "A file name or file-like object specifying a script to run each time a
 torrent completes, when @code{script-torrent-done-enabled?} is @code{#t}.")
   (scrape-paused-torrents-enabled?
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 26d47f47de..04653f7dab 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -75,6 +75,7 @@ (define (make-pred arg)
       (lambda (field target)
         (and (memq (syntax->datum target) `(common ,arg)) field)))
     (syntax-case stx ()
+      ;; TODO Also handle (field-type) form, without a default.
       ((_ stem (field (field-type def) doc target) ...)
        (with-syntax (((new-field-type ...)
                       (map (lambda (field-type target)
@@ -88,7 +89,7 @@ (define (make-pred arg)
                      ((new-def ...)
                       (map (lambda (def target)
                              (if (eq? 'common (syntax->datum target))
-                                 #''disabled def))
+                                 #'*unspecified* def))
                            #'(def ...) #'(target ...)))
                      ((new-doc ...)
                       (map (lambda (doc target)
@@ -198,7 +199,7 @@ (define (serialize-file-object-list field-name val)
 (define-maybe file-object-list)
 
 (define (raw-content? val)
-  (not (eq? val 'disabled)))
+  (not (unspecified? val)))
 (define (serialize-raw-content field-name val)
   val)
 (define-maybe raw-content)
@@ -226,15 +227,15 @@ (define-maybe mod-muc-configuration)
 
 (define-configuration ssl-configuration
   (protocol
-   (maybe-string 'disabled)
+   maybe-string
    "This determines what handshake to use.")
 
   (key
-   (maybe-file-name 'disabled)
+   maybe-file-name
    "Path to your private key file.")
 
   (certificate
-   (maybe-file-name 'disabled)
+   maybe-file-name
    "Path to your certificate file.")
 
   (capath
@@ -243,48 +244,48 @@ (define-configuration ssl-configuration
 trust when verifying the certificates of remote servers.")
 
   (cafile
-   (maybe-file-object 'disabled)
+   maybe-file-object
    "Path to a file containing root certificates that you wish Prosody to trust.
 Similar to @code{capath} but with all certificates concatenated together.")
 
   (verify
-   (maybe-string-list 'disabled)
+   maybe-string-list
    "A list of verification options (these mostly map to OpenSSL's
 @code{set_verify()} flags).")
 
   (options
-   (maybe-string-list 'disabled)
+   maybe-string-list
    "A list of general options relating to SSL/TLS.  These map to OpenSSL's
 @code{set_options()}.  For a full list of options available in LuaSec, see the
 LuaSec source.")
 
   (depth
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "How long a chain of certificate authorities to check when looking for a
 trusted root certificate.")
 
   (ciphers
-   (maybe-string 'disabled)
+   maybe-string
    "An OpenSSL cipher string.  This selects what ciphers Prosody will offer to
 clients, and in what order.")
 
   (dhparam
-   (maybe-file-name 'disabled)
+   maybe-file-name
    "A path to a file containing parameters for Diffie-Hellman key exchange.  You
 can create such a file with:
 @code{openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048}")
 
   (curve
-   (maybe-string 'disabled)
+   maybe-string
    "Curve for Elliptic curve Diffie-Hellman. Prosody's default is
 @samp{\"secp384r1\"}.")
 
   (verifyext
-   (maybe-string-list 'disabled)
+   maybe-string-list
    "A list of \"extra\" verification options.")
 
   (password
-   (maybe-string 'disabled)
+   maybe-string
    "Password for encrypted private keys."))
 (define (serialize-ssl-configuration field-name val)
   #~(format #f "ssl = {\n~a};\n"
@@ -472,12 +473,12 @@ (define-all-configurations prosody-configuration
      global)
 
     (http-max-content-size
-     (maybe-non-negative-integer 'disabled)
+     (maybe-non-negative-integer *unspecified*)
      "Maximum allowed size of the HTTP body (in bytes)."
      common)
 
     (http-external-url
-     (maybe-string 'disabled)
+     (maybe-string *unspecified*)
      "Some modules expose their own URL in various ways.  This URL is built
 from the protocol, host and port used.  If Prosody sits behind a proxy, the
 public URL will be @code{http-external-url} instead.  See
@@ -554,7 +555,7 @@ (define-all-configurations prosody-configuration
      int-component)
 
     (mod-muc
-     (maybe-mod-muc-configuration 'disabled)
+     (maybe-mod-muc-configuration *unspecified*)
      "Multi-user chat (MUC) is Prosody's module for allowing you to create
 hosted chatrooms/conferences for XMPP users.
 
@@ -571,7 +572,7 @@ (define-all-configurations prosody-configuration
      ext-component)
 
     (raw-content
-     (maybe-raw-content 'disabled)
+     (maybe-raw-content *unspecified*)
      "Raw content that will be added to the configuration file."
      common)))
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 399cd03c1d..8cd3a95e07 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -765,17 +765,17 @@ (define-configuration/no-serialization opendht-configuration
    "The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the @code{:PORT}
 suffix.  By default, it uses the Jami bootstrap nodes, but any host can be
-specified here.  It's also possible to disable bootstrapping by setting this
-to the @code{'disabled} symbol.")
+specified here.  It's also possible to disable bootstrapping by explicitly
+setting this field to the @code{*unspecified*} value.")
   (port
    (maybe-number 4222)
-   "The UDP port to bind to.  When set to @code{'disabled}, an available port
-is automatically selected.")
+   "The UDP port to bind to.  When set to @code{*unspecified*}, an available
+port is automatically selected.")
   (proxy-server-port
-   (maybe-number 'disabled)
+   maybe-number
    "Spawn a proxy server listening on the specified port.")
   (proxy-server-port-tls
-   (maybe-number 'disabled)
+   maybe-number
    "Spawn a proxy server listening to TLS connections on the specified
 port."))
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index e48236dbca..3daf484cc1 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -114,55 +114,55 @@ (define-configuration tlp-configuration
    "Same as @code{max-lost-work-secs-on-ac} but on BAT mode.")
 
   (cpu-scaling-governor-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "CPU frequency scaling governor on AC mode.  With intel_pstate
 driver, alternatives are powersave and performance.  With acpi-cpufreq driver,
 alternatives are ondemand, powersave, performance and conservative.")
 
   (cpu-scaling-governor-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Same as @code{cpu-scaling-governor-on-ac} but on BAT mode.")
 
   (cpu-scaling-min-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the min available frequency for the scaling governor on AC.")
 
   (cpu-scaling-max-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the max available frequency for the scaling governor on AC.")
 
   (cpu-scaling-min-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the min available frequency for the scaling governor on BAT.")
 
   (cpu-scaling-max-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the max available frequency for the scaling governor on BAT.")
 
   (cpu-min-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Limit the min P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-max-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Limit the max P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-min-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Same as @code{cpu-min-perf-on-ac} on BAT mode.")
 
   (cpu-max-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Same as @code{cpu-max-perf-on-ac} on BAT mode.")
 
   (cpu-boost-on-ac?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Enable CPU turbo boost feature on AC mode.")
 
   (cpu-boost-on-bat?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Same as @code{cpu-boost-on-ac?} on BAT mode.")
 
   (sched-powersave-on-ac?
@@ -179,7 +179,7 @@ (define-configuration tlp-configuration
    "Enable Linux kernel NMI watchdog.")
 
   (phc-controls
-   (maybe-string 'disabled)
+   maybe-string
    "For Linux kernels with PHC patch applied, change CPU voltages.
 An example value would be @samp{\"F:V F:V F:V F:V\"}.")
 
@@ -205,16 +205,16 @@ (define-configuration tlp-configuration
    "Same as @code{disk-apm-bat} but on BAT mode.")
 
   (disk-spindown-timeout-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Hard disk spin down timeout.  One value has to be specified for
 each declared hard disk.")
 
   (disk-spindown-timeout-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Same as @code{disk-spindown-timeout-on-ac} but on BAT mode.")
 
   (disk-iosched
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Select IO scheduler for disk devices.  One value has to be specified
 for each declared hard disk.  Example alternatives are cfq, deadline and noop.")
 
@@ -228,16 +228,16 @@ (define-configuration tlp-configuration
    "Same as @code{sata-linkpwr-ac} but on BAT mode.")
 
   (sata-linkpwr-blacklist
-   (maybe-string 'disabled)
+   maybe-string
    "Exclude specified SATA host devices for link power management.")
 
   (ahci-runtime-pm-on-ac?
-   (maybe-on-off-boolean 'disabled)
+   maybe-on-off-boolean
    "Enable Runtime Power Management for AHCI controller and disks
 on AC mode.")
 
   (ahci-runtime-pm-on-bat?
-   (maybe-on-off-boolean 'disabled)
+   maybe-on-off-boolean
    "Same as @code{ahci-runtime-pm-on-ac} on BAT mode.")
 
   (ahci-runtime-pm-timeout
@@ -254,19 +254,19 @@ (define-configuration tlp-configuration
    "Same as @code{pcie-aspm-ac} but on BAT mode.")
 
   (start-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 0 should begin charging.")
 
   (stop-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 0 should stop charging.")
 
   (start-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 1 should begin charging.")
 
   (stop-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 1 should stop charging.")
 
   (radeon-power-profile-on-ac
@@ -346,7 +346,7 @@ (define-configuration tlp-configuration
 blacklisted ones.")
 
   (runtime-pm-blacklist
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Exclude specified PCI(e) device addresses from Runtime Power Management.")
 
   (runtime-pm-driver-blacklist
@@ -359,7 +359,7 @@ (define-configuration tlp-configuration
    "Enable USB autosuspend feature.")
 
   (usb-blacklist
-   (maybe-string 'disabled)
+   maybe-string
    "Exclude specified devices from USB autosuspend.")
 
   (usb-blacklist-wwan?
@@ -367,12 +367,12 @@ (define-configuration tlp-configuration
    "Exclude WWAN devices from USB autosuspend.")
 
   (usb-whitelist
-   (maybe-string 'disabled)
+   maybe-string
    "Include specified devices into USB autosuspend, even if they are
 already excluded by the driver or via @code{usb-blacklist-wwan?}.")
 
   (usb-autosuspend-disable-on-shutdown?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Enable USB autosuspend before shutdown.")
 
   (restore-device-state-on-startup?
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index d8ebc7b39d..d585997524 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -156,7 +156,7 @@ (define-configuration jami-account
 secret key material of the Jami account it contains."
    empty-serializer)
   (allowed-contacts
-   (maybe-account-fingerprint-list 'disabled)
+   maybe-account-fingerprint-list
    "The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in that list
 will be rejected.  When unspecified, the configuration of the account archive
@@ -165,7 +165,7 @@ (define-configuration jami-account
 the account."
    empty-serializer)
   (moderators
-   (maybe-account-fingerprint-list 'disabled)
+   maybe-account-fingerprint-list
    "The list of contacts that should have moderation privileges (to ban, mute,
 etc. other users) in rendezvous conferences, entered as their 40 characters
 long fingerprint.  When unspecified, the configuration of the account archive
@@ -174,24 +174,24 @@ (define-configuration jami-account
    empty-serializer)
   ;; The serializable fields below are to be set with set-account-details.
   (rendezvous-point?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Whether the account should operate in the rendezvous mode.  In this mode,
 all the incoming audio/video calls are mixed into a conference.  When left
 unspecified, the value from the account archive prevails.")
   (peer-discovery?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful to
 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 'disabled)
+   maybe-string-list
    "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.")
   (name-server-uri
-   (maybe-string 'disabled)
+   maybe-string
    "The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username."))
 
@@ -213,7 +213,7 @@ (define (field-name->account-detail name)
                                    name ((configuration-field-getter field)
                                          jami-account-object)))
                            ;; The define-maybe default serializer produces an
-                           ;; empty string for the 'disabled value.
+                           ;; empty string for unspecified values.
                            (value* (if (string-null? value)
                                        #f
                                        value)))
@@ -246,7 +246,7 @@ (define-configuration/no-serialization jami-configuration
    (boolean #f)
    "Whether to force automatic answer to incoming calls.")
   (accounts
-   (maybe-jami-account-list 'disabled)
+   maybe-jami-account-list
    "A list of Jami accounts to be (re-)provisioned every time the Jami daemon
 service starts.  When providing this field, the account directories under
 @file{/var/lib/jami/} are recreated every time the service starts, ensuring a
@@ -294,7 +294,7 @@ (define (jami-shepherd-services config)
          (dbus-daemon (file-append dbus "/bin/dbus-daemon"))
          (dbus-send (file-append dbus "/bin/dbus-send"))
          (accounts (jami-configuration-accounts config))
-         (declarative-mode? (not (eq? 'disabled accounts))))
+         (declarative-mode? (not (unspecified? accounts))))
 
     (with-imported-modules (source-module-closure
                             '((gnu build jami-service)
@@ -685,7 +685,7 @@ (define (archive-name->username archive)
                                           account-details)
                            (let ((username (archive-name->username
                                             archive)))
-                             (when (not (eq? 'disabled allowed-contacts))
+                             (when (not (unspecified? allowed-contacts))
                                ;; Reject calls from unknown contacts.
                                (set-account-details
                                 '(("DHT.PublicInCalls" . "false")) username)
@@ -695,7 +695,7 @@ (define (archive-name->username archive)
                                ;; Add allowed ones.
                                (for-each (cut add-contact <> username)
                                          allowed-contacts))
-                             (when (not (eq? 'disabled moderators))
+                             (when (not (unspecified? moderators))
                                ;; Disable the 'AllModerators' property.
                                (set-all-moderators #f username)
                                ;; Remove all moderators.
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index a3dc96c1a2..8be632d55f 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -363,7 +363,7 @@ (define-split-configuration openvpn-client-configuration
 channel to protect against DoS attacks.")
 
    (auth-user-pass
-     (maybe-string 'disabled)
+    maybe-string
      "Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.")
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 0debf8095b..334a1e409b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -136,3 +136,15 @@ (define-configuration config-with-maybe-string/no-serialization
 
 (test-assert "maybe value without serialization no procedure bound"
   (not (defined? 'serialize-maybe-string)))
+
+(test-assert "maybe type, no default"
+  (unspecified?
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization))))
+
+(test-assert "maybe type, with default"
+  (equal?
+   "foo"
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization
+     (name "foo")))))
-- 
2.35.1





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 17 May 2022 11:40:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 07:40:10 2022
Received: from localhost ([127.0.0.1]:55961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nqvYe-0005cu-SH
	for submit <at> debbugs.gnu.org; Tue, 17 May 2022 07:40:09 -0400
Received: from mail-ej1-f47.google.com ([209.85.218.47]:39528)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1nqvYc-0005cS-SD
 for 54674 <at> debbugs.gnu.org; Tue, 17 May 2022 07:40:07 -0400
Received: by mail-ej1-f47.google.com with SMTP id tk15so10609824ejc.6
 for <54674 <at> debbugs.gnu.org>; Tue, 17 May 2022 04:40:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=6uUZF8XXQGeV4rmDblZZ7y/STfpyc3AamXzBcSZcbQ4=;
 b=mqWs1SKPYQnzFYvkg3eREGSBUoZmAEUNR4WDhFuj/uLpweSpQuIEpjJ77XPDXS2U4v
 5JTX1rdhm3zFG3bgYITKU35xUjzulybXwrQmsz6Jzl6j6O2GNREYl4fX2gK1Eg44fWpl
 cNlT/HeR33/rQDclkF54O8s7r3GReOljt/7xDI8yi1vLJ8KefwiRrtCgsVCHL7wX3Hta
 gX1nCnR0Hn68BwqCxxqHP6RZ1BU602fAvCxTYsPFdVdZO2BYWci5eIEYU+Kh7CIITfVT
 zFuEpUw9acuQH9vSjA/jH0hQEBLajpnlu1mDZao6ebou+Rtf+Lr/Au2pr4S3jhBABpFV
 6YVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :mime-version:content-transfer-encoding;
 bh=6uUZF8XXQGeV4rmDblZZ7y/STfpyc3AamXzBcSZcbQ4=;
 b=AlTQeVc+6+ARltmo13jAMrg+ofWgUDYCgVWrXfT12BMQIK6MK2DkrLy9NteBnUcBTQ
 GtUI5DGcMXfYaOFiIMwoV8fCgNjPIrT7kUQUvsJZKTTW2fMCkxZJofcIdaEJIc5AOAXJ
 EbubGUoT/LHKeGo4/MDgjoxVMhqtkVGjVlNeUQoVCf2TyOASvw4AX1pHwKF6LAR36jRE
 LgRrqnTYHdAEJkWnoMr3PBJiZFAX7kAGJ23Dz+5GmVMFqIvH/uuxF43Vfnmm392HvCyb
 iPyPjitCpouhGrEsqe443QeH3IxgdtajTLBggZSLnrACyNZ3qZoJLx4xr/AbspcRVwmH
 cndw==
X-Gm-Message-State: AOAM532lRpt5+bElHahhYxYDqyC8+TCQhEgpUb1n+ZNcKuVKHWjTtZ6D
 YNpQc9kIivEWJqnLAqFMf1xgYXAGsPE=
X-Google-Smtp-Source: ABdhPJxvhf7kwMXL4pnKj0Q1SY7ylBmlBrSrDZQgXx/ddbfjGS3Ap/+NT8UsS2UFoWmGeYdhgFJrqA==
X-Received: by 2002:a17:906:d554:b0:6f5:2242:a499 with SMTP id
 cr20-20020a170906d55400b006f52242a499mr19140339ejc.488.1652787600765; 
 Tue, 17 May 2022 04:40:00 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 12-20020a17090602cc00b006fe7725ed7dsm9154ejk.34.2022.05.17.04.39.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 17 May 2022 04:40:00 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v5 1/3] services: configuration: Support (field1 maybe-number
 "") format.
Date: Tue, 17 May 2022 13:39:26 +0200
Message-Id: <20220517113926.3931-1-attila@HIDDEN>
X-Mailer: git-send-email 2.35.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.1 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  As opposed to explicitly using 'disabled as value, or using
 the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
 shared under #54674, with some modifications by Attila Lendvai. 
 Content analysis details:   (2.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (attila.lendvai[at]gmail.com)
 1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.218.47 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.218.47 listed in wl.mailspike.net]
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.1 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  As opposed to explicitly using 'disabled as value, or using
    the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
    shared under #54674, with some modifications by Attila Lendvai. 
 
 Content analysis details:   (1.1 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.218.47 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.218.47 listed in wl.mailspike.net]
  0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (attila.lendvai[at]gmail.com)
  1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

As opposed to explicitly using 'disabled as value, or using the
(field1 (maybe-number) "") format.

It's mostly the work of Maxime Devos shared under #54674, with some
modifications by Attila Lendvai.

* gnu/services/configuration.scm (normalize-field-type+def): New function.
(define-configuration-helper) (define-configuration): Support new field
format.
* tests/services/configuration.scm (config-with-maybe-number->string): New
function.
("maybe value serialization of the instance"): New test.
("maybe value serialization of the instance, unspecified"): New test.
---

v5 fixes some jami issues

 gnu/services/configuration.scm   | 169 +++++++++++++++++--------------
 tests/services/configuration.scm |  28 ++++-
 2 files changed, 114 insertions(+), 83 deletions(-)

diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 0de350a4df..bdca33ed68 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
+;;; Copyright © 2022 Maxime Devos <maximedevos@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -162,78 +163,90 @@ (define-maybe-helper #t #f #'(_ stem))))))
 (define-syntax-rule (define-maybe/no-serialization stem)
   (define-maybe stem (no-serialization)))
 
+(define (normalize-field-type+def s)
+  (syntax-case s ()
+    ((field-type def)
+     (identifier? #'field-type)
+     (values #'(field-type def)))
+    ((field-type)
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))
+    (field-type
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))))
+
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
-    ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
-     (with-syntax (((field-getter ...)
-                    (map (lambda (field)
-                           (id #'stem #'stem #'- field))
-    			 #'(field ...)))
-                   ((field-predicate ...)
-                    (map (lambda (type)
-                           (id #'stem type #'?))
-    			 #'(field-type ...)))
-                   ((field-default ...)
-                    (map (match-lambda
-    			   ((field-type default-value)
-                            default-value)
-    			   ((field-type)
-                            ;; Quote `undefined' to prevent a possibly
-                            ;; unbound warning.
-                            (syntax 'undefined)))
-    			 #'((field-type def ...) ...)))
-                   ((field-serializer ...)
-                    (map (lambda (type custom-serializer)
-                           (and serialize?
-                                (match custom-serializer
-                                  ((serializer)
-                                   serializer)
-                                  (()
-                                   (if serializer-prefix
-                                       (id #'stem
-                                           serializer-prefix
-                                           #'serialize- type)
-                                       (id #'stem #'serialize- type))))))
-                         #'(field-type ...)
-                         #'((custom-serializer ...) ...))))
-       #`(begin
-    	   (define-record-type* #,(id #'stem #'< #'stem #'>)
-    	     #,(id #'stem #'% #'stem)
-    	     #,(id #'stem #'make- #'stem)
-    	     #,(id #'stem #'stem #'?)
-    	     (%location #,(id #'stem #'stem #'-location)
-    			(default (and=> (current-source-location)
-    					source-properties->location))
-    			(innate))
-    	     #,@(map (lambda (name getter def)
-    		       (if (eq? (syntax->datum def) (quote 'undefined))
-    			   #`(#,name #,getter)
-    			   #`(#,name #,getter (default #,def))))
-    		     #'(field ...)
-    		     #'(field-getter ...)
-    		     #'(field-default ...)))
-    	   (define #,(id #'stem #'stem #'-fields)
-    	     (list (configuration-field
-    		    (name 'field)
-    		    (type 'field-type)
-    		    (getter field-getter)
-    		    (predicate field-predicate)
-    		    (serializer field-serializer)
-    		    (default-value-thunk
-    		      (lambda ()
-    			(display '#,(id #'stem #'% #'stem))
-    			(if (eq? (syntax->datum field-default)
-    				 'undefined)
-    			    (configuration-no-default-value
-    			     '#,(id #'stem #'% #'stem) 'field)
-    			    field-default)))
-    		    (documentation doc))
-    		   ...))
-    	   (define-syntax-rule (stem arg (... ...))
-    	     (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
-    	       (validate-configuration conf
-    				       #,(id #'stem #'stem #'-fields))
-    	       conf)))))))
+    ((_ stem (field field-type+def doc custom-serializer ...) ...)
+     (with-syntax
+         ((((field-type def) ...)
+           (map normalize-field-type+def #'(field-type+def ...))))
+       (with-syntax
+           (((field-getter ...)
+             (map (lambda (field)
+                    (id #'stem #'stem #'- field))
+                  #'(field ...)))
+            ((field-predicate ...)
+             (map (lambda (type)
+                    (id #'stem type #'?))
+                  #'(field-type ...)))
+            ((field-default ...)
+             (map (match-lambda
+                    ((field-type default-value)
+                     default-value))
+                  #'((field-type def) ...)))
+            ((field-serializer ...)
+             (map (lambda (type custom-serializer)
+                    (and serialize?
+                         (match custom-serializer
+                           ((serializer)
+                            serializer)
+                           (()
+                            (if serializer-prefix
+                                (id #'stem
+                                    serializer-prefix
+                                    #'serialize- type)
+                                (id #'stem #'serialize- type))))))
+                  #'(field-type ...)
+                  #'((custom-serializer ...) ...))))
+         #`(begin
+             (define-record-type* #,(id #'stem #'< #'stem #'>)
+               #,(id #'stem #'% #'stem)
+               #,(id #'stem #'make- #'stem)
+               #,(id #'stem #'stem #'?)
+               (%location #,(id #'stem #'stem #'-location)
+                          (default (and=> (current-source-location)
+                                          source-properties->location))
+                          (innate))
+               #,@(map (lambda (name getter def)
+                         (if (eq? (syntax->datum def) (quote 'undefined))
+                             #`(#,name #,getter)
+                             #`(#,name #,getter (default #,def))))
+                       #'(field ...)
+                       #'(field-getter ...)
+                       #'(field-default ...)))
+             (define #,(id #'stem #'stem #'-fields)
+               (list (configuration-field
+                      (name 'field)
+                      (type 'field-type)
+                      (getter field-getter)
+                      (predicate field-predicate)
+                      (serializer field-serializer)
+                      (default-value-thunk
+                        (lambda ()
+                          (display '#,(id #'stem #'% #'stem))
+                          (if (eq? (syntax->datum field-default)
+                                   'undefined)
+                              (configuration-no-default-value
+                               '#,(id #'stem #'% #'stem) 'field)
+                              field-default)))
+                      (documentation doc))
+                     ...))
+             (define-syntax-rule (stem arg (... ...))
+               (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
+                 (validate-configuration conf
+                                         #,(id #'stem #'stem #'-fields))
+                 conf))))))))
 
 (define no-serialization         ;syntactic keyword for 'define-configuration'
   '(no serialization))
@@ -241,26 +254,26 @@ (define no-serialization         ;syntactic keyword for 'define-configuration'
 (define-syntax define-configuration
   (lambda (s)
     (syntax-case s (no-serialization prefix)
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem (field field-type+def doc custom-serializer ...) ...
           (no-serialization))
        (define-configuration-helper
-         #f #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #f #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...)))
-      ((_ stem  (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem  (field field-type+def doc custom-serializer ...) ...
           (prefix serializer-prefix))
        (define-configuration-helper
-         #t #'serializer-prefix #'(_ stem (field (field-type def ...)
+         #t #'serializer-prefix #'(_ stem (field field-type+def
                                                  doc custom-serializer ...)
                  ...)))
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
+      ((_ stem (field field-type+def doc custom-serializer ...) ...)
        (define-configuration-helper
-         #t #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #t #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...))))))
 
 (define-syntax-rule (define-configuration/no-serialization
-                      stem (field (field-type def ...)
+                      stem (field field-type+def
                                   doc custom-serializer ...) ...)
-  (define-configuration stem (field (field-type def ...)
+  (define-configuration stem (field field-type+def
                                     doc custom-serializer ...) ...
     (no-serialization)))
 
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 86a36a388d..0debf8095b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -27,6 +27,9 @@ (define-module (tests services configuration)
 
 (test-begin "services-configuration")
 
+(define (serialize-number field value)
+  (format #f "~a=~a" field value))
+
 
 ;;;
 ;;; define-configuration macro.
@@ -47,7 +50,6 @@ (define-configuration port-configuration-cs
   80
   (port-configuration-cs-port (port-configuration-cs)))
 
-(define serialize-number "")
 (define-configuration port-configuration-ndv
   (port (number) "The port number."))
 
@@ -101,15 +103,31 @@ (define-configuration configuration-with-prefix
 (define-maybe number)
 
 (define-configuration config-with-maybe-number
-  (port (maybe-number 80) "The port number."))
-
-(define (serialize-number field value)
-  (format #f "~a=~a" field value))
+  (port  (maybe-number 80) "")
+  (count maybe-number ""))
 
 (test-equal "maybe value serialization"
   "port=80"
   (serialize-maybe-number "port" 80))
 
+(define (config-with-maybe-number->string x)
+  (eval (gexp->approximate-sexp
+         (serialize-configuration x config-with-maybe-number-fields))
+        (current-module)))
+
+(test-equal "maybe value serialization of the instance"
+  "port=42count=43"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42)
+    (count 43))))
+
+(test-equal "maybe value serialization of the instance, unspecified"
+  "port=42"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42))))
+
 (define-maybe/no-serialization string)
 
 (define-configuration config-with-maybe-string/no-serialization
-- 
2.35.1





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 17 May 2022 11:38:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 17 07:38:50 2022
Received: from localhost ([127.0.0.1]:55957 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nqvXO-0005aR-IR
	for submit <at> debbugs.gnu.org; Tue, 17 May 2022 07:38:50 -0400
Received: from mail-40136.proton.ch ([185.70.40.136]:37080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila@HIDDEN>) id 1nqvXM-0005aC-3f
 for 54674 <at> debbugs.gnu.org; Tue, 17 May 2022 07:38:49 -0400
Date: Tue, 17 May 2022 11:38:35 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name;
 s=protonmail3; t=1652787520; x=1653046720;
 bh=gMVG+Xb5D9v0AgICmr+zvQp+4QXFSW7+TwuX1JV7s64=;
 h=Date:To:From:Reply-To:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID;
 b=QBArmiSbAeOVUx4vNOvu10rqnsSn2GvcDlly/txHRk7ZWekx+rJTeEFb8lm9MwZA+
 rmgWd+p1bL8wSUSBWVLD10xjxGMf2vnmksklK1PDYvaRi1bxnO7DVGUtgNaW13dmJC
 Ln2CSvi82Nqm3cZr50gwMruzbXg5fl3jU4+6yHIYe6ZcBDuppj0/qJx/u8Twh6e9zn
 OLRcO62qU9s1afttJa8dv1DoTsC9IqgDQQKpJvJbR3YmdjkrJ1oGjVvmk9FOVfJL2i
 Fps1tBnPe/sWoAnT/CWe3cFnRT6JG0ykYDxf71/rMJWswV2620Tx4ZlLkBpMFIMN/q
 t0cEqZfgjl7eg==
To: 54674 <at> debbugs.gnu.org
From: Attila Lendvai <attila@HIDDEN>
Subject: Re: [bug#54674] [PATCH v4 1/2] services: configuration: Support
 (field1 maybe-number "") format.
Message-ID: <_T-G43zruF_RwIN_x5jlycFSZ3wxWqlJaJAwz2W47H8aXUUFI1XEjI8WWK-SigdA7HW8mxR-bM0xIto1mKJk7vbVkru8XtMazqOksHuc9oc=@lendvai.name>
In-Reply-To: <813b73d348bd7de3e19573f5e4261da2120711c0.camel@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
 <20220420091553.26732-1-attila@HIDDEN>
 <813b73d348bd7de3e19573f5e4261da2120711c0.camel@HIDDEN>
Feedback-ID: 28384833:user:proton
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="b1_Ls9sDtzUSCcahhmT7qsbwqeBOtxzSCDeVytFbZL8CY"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Attila Lendvai <attila@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.

--b1_Ls9sDtzUSCcahhmT7qsbwqeBOtxzSCDeVytFbZL8CY
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

thank you for suggesting `make check-system` Maxime. it pointed out some is=
sues with the jami service that i have fixed.

i would love to reshape this into something that will get merged. is there =
anything i can do to help that process?

unfortunately, `make check-system` returns with the attached output. after =
some staring and grepping, i can't identify why these tests are failing, an=
d whether it is a new bug at all that happens due to my changes.

i'll send the new version of the patch in upcoming mails.

--
=E2=80=A2 attila lendvai
=E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39
--
=E2=80=9CAnything that can contribute to such a fundamental change in our p=
erception of reality must therefore command our earnest attention.=E2=80=
=9D
=09=E2=80=94 Albert Hofmann (1906=E2=80=932008), 'LSD: My Problem Child'

--b1_Ls9sDtzUSCcahhmT7qsbwqeBOtxzSCDeVytFbZL8CY
Content-Type: application/gzip; name=b5gqxwxi4hs5cd4qngxca91l81yd9l-jami-provisioning-test.drv.gz
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=b5gqxwxi4hs5cd4qngxca91l81yd9l-jami-provisioning-test.drv.gz

H4sIAAAAAAACA+1b/3PTOBb/3TP5C/jlXZi7JnfYsZ2k+bLHdEpb2O7Akmth2RmGYRVLTkRt2ZXs
pOlff09ynKSFMgm0JSx4oDXS09P78nlPepJ5EDx4u9eJHrz1f3vw1o1PGXly/PIUahMmFU8ESBbZ
nuO1Hdd27ZFPaWvYGzbDbsu1U8mGOY8y55zFuZPIUb1iWRYf/HkEtXGWpf1Gg6cXzPSA6/bdpuPC
wb7rwuDg2Hc8/C0GMHjx4j/e06c9z/dcfDl6ql8MWcUaSKYUHGQysp9AlkCQiJCPcsmgmAX5lIzr
juNU4HYfrc6TJMm4GEEokxhOXr5wnAdXLeZUnh3AGyIFUvUhzcaSEfp+xDKSZfK9SCGRi1bThF0q
I8EZhIRHjEKIBDHhAgqiirXK7yDJIyp2MtBd0EhlEjRwdFax3rAoSGL2CIdxBfjn2e+vdxQwIqMZ
DFFqeIbOYU7Feq0Y7IxE7kiWRjtmPiKAC55JCidHg+dIU7GihFCt6BmTgkUQJzSPmNJWXXTtNJAL
Tp9I1ojSzmz3ctR0O+OZml5G45loR5fTC39KZafXC201UxmLG1qSHcMlJmdfyGQHdWQQ5FIykUHR
Zlgqlhnn5Cnga84poIFGksRoEIEzyVw0ig677ChkSZM0j4gZ22BZUHh3RbCmnO2mvoxouy1DEvao
csfttN2e+dMmP2sqGwcZRoOIETTvlPAMpmO0N4wICis1ZxRWJulMA3fEBJMkY0aRMzaDlHD5S8Uy
vosJ0pAz7OQxK/RSYxupcFS/HKoZCjaFcaIyzUH14eR0Hw7x79GB+Xnot9teD0EbIFYWqjViEoy5
YDanhjWTEv2P1gm5IBG/RMqkhF4fTvMgwJCrWG81/pvOrtf03c47yCmb0Leev/uuDyJBYwvKJOBE
FJXkJFKIz4DxCaOPIEYGZIQhOhJoSrrg1W22ul3vHRxpCfpwKJFcwk4aqPRM7mgEk0hLMUNeI44+
lpobGSZSK2OEFypAIb2Wj/BE+CbGzKG2+l9GV20c9RfUvHrlBmLKUVB8nxUjkNa/kXaFMeahJJo4
Ov/gkOZts1dMTjgaHulbt81bKDXlWTAuhW9v3QT6j/VqnsV0gGAmK6McYJ7n0PsfSMwhSkYco+I3
/X5IGHIHz3Ncx30EwxmckknCpY2ZFdeI51zkF+C7bsv2Xa9XsfSipHBV0owcwbIGYvMPThkCOk9T
xBmGLBliTn6HHYMox5nUJ7oqltvp+92+5ztN11+sFol6HyDg3+eCXzgB/CP9EPEh4DrnmZQ7eHl6
/KfJulzHnQ6Mb6vES8GAJkxhQGNS5XGK68ZSvCLlRhzjuw/7SIJJDWghK7qJsgxdqZVYyZqul47l
5EJcyJF37o4uSLM96oSdzrm7G8hwd2KrMUuRD7VjIjHtYPZmjgrivtf3Ol63D0cnJy9P+hULwHPg
XyTQuclmFwFLizeTOXS3fuZB0wdtibKxGNMHXCNlVjZiuuxjlkWMFiwWxHKEabRWNV1VqGJmM68a
qymu1bgSVuFhWP/pqZ+e+ump2/bUdioZ4c7DJkGQ5CJTP5KyNsIPC5IfQ2esbvSmOpF/e3WHRNi4
McOC828fupQrnYlLQP8M3q/R2XrFsJaan1E8AprHqSbC7Xex918t49Nxh8Zi0pul6dQP2h+CsNuU
PPAmcdCS0aRra/F1BT7h+kwJ+dgZci+WW+S441jWP/GBU73C6Gl0t1HaeiYTrO6HzOz6TYsWbN6A
WmlKW5AYjVSdm0uvpVj563mqSKGSXAbM1lIjzYrYgo66geiOp27nMmzJi4ka97g/6U04DcMPvbMb
xLb1oRemjxXeERbYWO2sTJbIGO1syIlCubJPSge1JUpsNiER1M7zJGNQM/pBLVfMnp/EQA0lLxGh
QGOsXtcM0H1QM2uzXU4x56Ll1zQPQ+1TqNXm7XOyOhbaKk0EzpHiaAVYYy85otjntmThdaI5j7kK
mn0t5RR/iTweMrkH+l/FA0vt6vXCb0xQ7TXkmUeZfcbxnwZjlsF1TiIbrZCjMR+Gazg6IAIJcGOS
pCmj2+jsaxJ+rcOhJoVUmNQV05ZXuGMUE6gO9l/9itFszrvmx2Tl+RtqpI3RGHJRxRERywqHbRFy
FoAxQ7X5rmJpRdQkvUnShZ1qMdNjr/QvrGgmmfJsjPJlkiO574KH8+F2vXbJZLJnDJLlqs8ueGYb
DxWW/DdU05FkKdpZ86TV+j2jHLlpV201zpcy3jLSKQtRHNhO4N6I27k5bhJyrpRgU/t7UWwuq+4y
McPOjbLL9juMB3P+V5ZmsArhR2UztjKF2W+bQmQTsW85aj6R6UzTYpNa7CWv5soSWVcq4Xp97j1V
riGl6BoiSWDQVQuILMnqUA2bzVY79DudNqUhczukNXRpr00JI57nUa8dDgPP6/WqV5CmMn1W/Hhv
g/GrMpRiVfeLFwctJjWA7j5ff9bRUZRMGS1LMfXdAPS63LeJUHS2DDnoH7a3wOvG4CyLn2+CURIp
9mkAHv76yhnkw4gHx+IA7aiq85y6oZal6T9Wr+y5df1Qp+wxFFraAUdFl1PNvV316DAYumE7bHaa
fsv3u36z3d5tDTu90B/2Os0O6xHX7Ya4X/LXJf2mIbo8E/pegnNF4m0Ky6VYH0N22XcPoF2drIQt
WfNB2A7XfKr1jQObULo0E2ocrPlUNzHO52y/avD1jYhZQG0i7D1Y/c6zRbkPL9ypHukT1UYu8Cds
7WK+jsxbkjFWzqcxDtZeVOrwfuO8hFOJla3ManJiEyZn83LJjkg8pATHlltHcOD62MUxwwbr4Efz
16/H4VdYjq75bJZBvrWRi8QV4uJH95YmX1/XT5mch19WZJSC1qGUR1fAxft8AbjmzXtPTcVVdGN+
EbLYNmx/frpJ8Luoh9fC8rW7pPodR803K7M/W8GUJXThnS/Y5hQDfwAjZjLfxIb3VOFASiS2Zmx7
S5pVEb/Ho4WS4E6qmf8+BnaOjt9bGKK2wJP+1NUca+G6WdUfWSMWSerE7BcM6GhIgjOHFF8YGVJ9
97MYmzImD7kKEr0gGwZFElilkfoT38s/klwZAgNw3X+C3v/91MklN+3ll1PxzNHSONojiAitykcm
vAXcF7fBekRxF/wQkhBywS5S8+WUGZcjJ4Ce9b+jF6/10bYComBwfAiea+FGQBSUWQKaYEeVH6ha
5gt7M2jeoqvtOM2uDhrlWmb91fxNV9YAtTeSF/9pII8ic2WOA6u3eGFerVtLO5oLZf3dtHV7Id33
+vB0//g5fHxpfZezXL0tvYeZFvdVdzHXBgf/9z79tWPd+55/eahwZzOvUQPf39w37G/v2uwrq+tn
U+X/Aa4MuS8FNgAA

--b1_Ls9sDtzUSCcahhmT7qsbwqeBOtxzSCDeVytFbZL8CY--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 24 Apr 2022 22:46:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 24 18:46:32 2022
Received: from localhost ([127.0.0.1]:60309 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nikzw-000695-4m
	for submit <at> debbugs.gnu.org; Sun, 24 Apr 2022 18:46:32 -0400
Received: from mail-ej1-f45.google.com ([209.85.218.45]:42645)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1nikzt-00068p-Mg
 for 54674 <at> debbugs.gnu.org; Sun, 24 Apr 2022 18:46:30 -0400
Received: by mail-ej1-f45.google.com with SMTP id i27so26344388ejd.9
 for <54674 <at> debbugs.gnu.org>; Sun, 24 Apr 2022 15:46:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=htolp5+3Q5z1Kb0BB46Rrofh4a7IPRllPinynQfjEPU=;
 b=UfojvFe/h2qmQVKXCJAcH/jEbmYRgMcbsaFBSGeA3zrBKUvnc8+WlWIlefuRY3B9yj
 5IcIO64OIfRKANJ5LkiyOaYuewrwhGmyCnYM2Xk9rAuR8nOCxQ6TzY5XbQtLNXrOCuli
 FgykC5dYYghSmCFOAXPbggcIH/75IwFulWIuVlVNIAQT2vgFviaGG9yPuiyRksprJn3r
 SpbXV2Ef6Ew0W9O9FsqNPV8IjdUCKXBBWitSNjPvT6Kwyo764j2m4IDMepekCMWD75+x
 6YlOwW6892uQfYFtIjTbIOMFUeDAlDbu3UfhRltAoVUKHjNC+jYtGFpBbpV5fYTsFa8R
 59kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :mime-version:content-transfer-encoding;
 bh=htolp5+3Q5z1Kb0BB46Rrofh4a7IPRllPinynQfjEPU=;
 b=5YH+tkk0ssFdcNOdjxdDPe3+0bxLBOXUsyw0mYOseu/QBCROGKko0385dKPeHuDw5t
 MhbDr9UYYNft1r3EQoX2WiW+sz3YzFQbhKtAP8bVv6MqXf7S2DFUaBj7WtpE3DynXpKr
 liQL8ohOdFA/MWTjiXMw1qzkIuca37qs0t1Om1toOlO699QXxwYQ/y6uweiaaUemaoAJ
 eOMSbUNUz5Mreisa5P7IILBBfcMKqyHizy6RyzihxGPyG4vjFFI86GB4jIVtErCpLWpC
 6QUjMxOnjVJqkbqURQhEA1x8hKBygbthTyPGL7T1umwLyfbwFTwEzHoTpE8wQBr+Zp+4
 Kt0w==
X-Gm-Message-State: AOAM532P0KhI/+NQ8w01KhxvyIbYxxcylHIZleIBcbvj5TXTub0X7DJE
 0pb9+aPWimaFlNndu/+7ou+d5KB+DdoRkw==
X-Google-Smtp-Source: ABdhPJyjx9rFKPHTzzczXT6rjLQ6kg2e0HG9IchO6TPeA5itf7LYL5FPPPhpYW4Y2oKe5QcESP5U5Q==
X-Received: by 2002:a17:906:1692:b0:6e8:d245:44a9 with SMTP id
 s18-20020a170906169200b006e8d24544a9mr13545948ejd.639.1650840383514; 
 Sun, 24 Apr 2022 15:46:23 -0700 (PDT)
Received: from localhost.localdomain (82-99-152-25.static.bluetone.cz.
 [82.99.152.25]) by smtp.gmail.com with ESMTPSA id
 q11-20020a170906144b00b006cf61dfb03esm2991426ejc.62.2022.04.24.15.46.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 24 Apr 2022 15:46:23 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH] doc: Follow the 'disabled -> *unspecified* configuration
 refactor.
Date: Mon, 25 Apr 2022 00:41:25 +0200
Message-Id: <20220424224124.6823-1-attila@HIDDEN>
X-Mailer: git-send-email 2.35.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 4.0 (++++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: --- update the doc in a separate commit. you may want to
 squash
 it on the refactor commit, depending on what trade off the project prefers.
 doc/guix.texi | 85 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+),
 42 deletions(-) 
 Content analysis details:   (4.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [82.99.152.25 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (attila.lendvai[at]gmail.com)
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.218.45 listed in list.dnswl.org]
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [209.85.218.45 listed in wl.mailspike.net]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 3.0 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  --- update the doc in a separate commit. you may want to squash
    it on the refactor commit, depending on what trade off the project prefers.
    doc/guix.texi | 85 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+),
    42 deletions(-) 
 
 Content analysis details:   (3.0 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.218.45 listed in list.dnswl.org]
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [209.85.218.45 listed in wl.mailspike.net]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [82.99.152.25 listed in zen.spamhaus.org]
  0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (attila.lendvai[at]gmail.com)
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

---

update the doc in a separate commit. you may want to squash it on the
refactor commit, depending on what trade off the project prefers.

 doc/guix.texi | 85 ++++++++++++++++++++++++++-------------------------
 1 file changed, 43 insertions(+), 42 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a865b2e2e4..ac1b4d1d37 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -18623,15 +18623,16 @@ The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the
 @code{:PORT} suffix.  By default, it uses the Jami bootstrap nodes, but
 any host can be specified here.  It's also possible to disable
-bootsrapping by setting this to the @code{'disabled} symbol.
+bootsrapping by explicitly setting this to the @code{*unspecified*}
+value.
 
 Defaults to @samp{"bootstrap.jami.net:4222"}.
 
 @end deftypevr
 
 @deftypevr {@code{opendht-configuration} parameter} maybe-number port
-The UDP port to bind to.  When set to @code{'disabled}, an available
-port is automatically selected.
+The UDP port to bind to.  When explicitly set to @code{*unspecified*},
+an available port is automatically selected.
 
 Defaults to @samp{4222}.
 
@@ -24396,7 +24397,7 @@ The available configuration parameters follow.  Each parameter
 definition is preceded by its type; for example, @samp{string-list foo}
 indicates that the @code{foo} parameter should be specified as a list of
 strings.  Types starting with @code{maybe-} denote parameters that won't
-show up in @code{prosody.cfg.lua} when their value is @code{'disabled}.
+show up in @code{prosody.cfg.lua} when their value is left unspecified.
 
 There is also a way to specify the configuration as a string, if you
 have an old @code{prosody.cfg.lua} file that you want to port over from
@@ -25010,7 +25011,7 @@ Whether to enable debug level messages.
 @item @code{auto-answer?} (default: @code{#f}) (type: boolean)
 Whether to force automatic answer to incoming calls.
 
-@item @code{accounts} (default: @code{disabled}) (type: maybe-jami-account-list)
+@item @code{accounts} (type: maybe-jami-account-list)
 A list of Jami accounts to be (re-)provisioned every time the Jami
 daemon service starts.  When providing this field, the account
 directories under @file{/var/lib/jami/} are recreated every time the
@@ -25032,39 +25033,39 @@ should @emph{not} be encrypted.  It is highly recommended to make it
 readable only to the @samp{root} user (i.e., not in the store), to guard
 against leaking the secret key material of the Jami account it contains.
 
-@item @code{allowed-contacts} (default: @code{disabled}) (type: maybe-account-fingerprint-list)
+@item @code{allowed-contacts} (type: maybe-account-fingerprint-list)
 The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in
-that list will be rejected.  When unspecified, the configuration of the
-account archive is used as-is with respect to contacts and public
+that list will be rejected.  When left specified, the configuration of
+the account archive is used as-is with respect to contacts and public
 inbound calls/messaging allowance, which typically defaults to allow any
 contact to communicate with the account.
 
-@item @code{moderators} (default: @code{disabled}) (type: maybe-account-fingerprint-list)
+@item @code{moderators} (type: maybe-account-fingerprint-list)
 The list of contacts that should have moderation privileges (to ban,
 mute, etc.  other users) in rendezvous conferences, entered as their 40
-characters long fingerprint.  When unspecified, the configuration of the
-account archive is used as-is with respect to moderation, which
+characters long fingerprint.  When left unspecified, the configuration
+of the account archive is used as-is with respect to moderation, which
 typically defaults to allow anyone to moderate.
 
-@item @code{rendezvous-point?} (default: @code{disabled}) (type: maybe-boolean)
+@item @code{rendezvous-point?} (type: maybe-boolean)
 Whether the account should operate in the rendezvous mode.  In this
 mode, all the incoming audio/video calls are mixed into a conference.
 When left unspecified, the value from the account archive prevails.
 
-@item @code{peer-discovery?} (default: @code{disabled}) (type: maybe-boolean)
+@item @code{peer-discovery?} (type: maybe-boolean)
 Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful
 to 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.
 
-@item @code{bootstrap-hostnames} (default: @code{disabled}) (type: maybe-string-list)
+@item @code{bootstrap-hostnames} (type: maybe-string-list)
 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.
 
-@item @code{name-server-uri} (default: @code{disabled}) (type: maybe-string)
+@item @code{name-server-uri} (type: maybe-string)
 The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username.
 
@@ -25698,8 +25699,8 @@ Defaults to @samp{prefer-encrypted-connections}.
 @deftypevr {@code{transmission-daemon-configuration} parameter} maybe-string peer-congestion-algorithm
 The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt}.  When left unspecified, the operating-system default
+is used.
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -29327,7 +29328,7 @@ Defaults to @samp{tun}.
 
 If you do not have some of these files (eg.@: you use a username and
 password), you can disable any of the following three fields by setting
-it to @code{'disabled}.
+it to @code{*unspecified*}.
 
 @deftypevr {@code{openvpn-client-configuration} parameter} maybe-string ca
 The certificate authority to check connections against.
@@ -29401,7 +29402,6 @@ Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.
 
-Defaults to @samp{'disabled}.
 @end deftypevr
 
 @deftypevr {@code{openvpn-client-configuration} parameter} key-usage verify-key-usage?
@@ -29482,7 +29482,7 @@ Defaults to @samp{tun}.
 
 If you do not have some of these files (eg.@: you use a username and
 password), you can disable any of the following three fields by setting
-it to @code{'disabled}.
+it to @code{*unspecified*}.
 
 @deftypevr {@code{openvpn-server-configuration} parameter} maybe-string ca
 The certificate authority to check connections against.
@@ -30281,10 +30281,10 @@ content by adding a valid @code{tlp-configuration}:
 @end deffn
 
 Each parameter definition is preceded by its type; for example,
-@samp{boolean foo} indicates that the @code{foo} parameter
-should be specified as a boolean.  Types starting with
-@code{maybe-} denote parameters that won't show up in TLP config file
-when their value is @code{'disabled}.
+@samp{boolean foo} indicates that the @code{foo} parameter should be
+specified as a boolean.  Types starting with @code{maybe-} denote
+parameters that won't show up in TLP config file when their value is
+left unset, or is explicitly set to the @code{*unspecified*} value.
 
 @c The following documentation was initially generated by
 @c (generate-tlp-documentation) in (gnu services pm).  Manually maintained
@@ -37840,15 +37840,16 @@ macro which is a shorthand of this.
 @deffn {Scheme Syntax} define-maybe @var{type}
 Sometimes a field should not be serialized if the user doesn’t specify a
 value.  To achieve this, you can use the @code{define-maybe} macro to
-define a ``maybe type''; if the value of a maybe type is set to the
-@code{disabled}, it will not be serialized.
+define a ``maybe type''; if the value of a maybe type is left unset, or
+is set to the @code{*unspecified*} value, then it will not be
+serialized.
 
 When defining a ``maybe type'', the corresponding serializer for the
 regular type will be used by default.  For example, a field of type
 @code{maybe-string} will be serialized using the @code{serialize-string}
 procedure by default, you can of course change this by specifying a
 custom serializer procedure.  Likewise, the type of the value would have
-to be a string, unless it is set to the @code{disabled} symbol.
+to be a string, or left unspecified.
 
 @lisp
 (define-maybe string)
@@ -37858,9 +37859,9 @@ to be a string, unless it is set to the @code{disabled} symbol.
 
 (define-configuration baz-configuration
   (name
-   ;; Nothing will be serialized by default.  If set to a string, the
-   ;; `serialize-string' procedure will be used to serialize the string.
-   (maybe-string 'disabled)
+   ;; If set to a string, the `serialize-string' procedure will be used
+   ;; to serialize the string.  Otherwise this field is not serialized.
+   maybe-string    ; equivalent to (maybe-string *unspecified*)
    "The name of this module."))
 @end lisp
 
@@ -37877,7 +37878,7 @@ serializer name by using the @code{prefix} literal.
 
 There is also the @code{no-serialization} literal, which when set means
 that no serializer will be defined for the ``maybe type'', regardless of
-its value is @code{disabled} or not.
+whether its value is set or not.
 @code{define-maybe/no-serialization} is a shorthand for specifying the
 @code{no-serialization} literal.
 
@@ -37886,7 +37887,7 @@ its value is @code{disabled} or not.
 
 (define-configuration/no-serialization test-configuration
   (mode
-   (maybe-symbol 'disabled)
+   maybe-symbol
    "Docstring."))
 @end lisp
 @end deffn
@@ -38018,10 +38019,10 @@ Below is an example of a record type created using
    "The name of the contact."
    serialize-contact-name)
   (phone-number
-   (maybe-integer 'disabled)
+   maybe-integer
    "The person's phone number.")
   (email
-   (maybe-string 'disabled)
+   maybe-string
    "The person's email address.")
   (married?
    (boolean)
@@ -38745,24 +38746,24 @@ Daytime color temperature (kelvins).
 @item @code{nighttime-temperature} (default: @code{4500}) (type: integer)
 Nighttime color temperature (kelvins).
 
-@item @code{daytime-brightness} (default: @code{disabled}) (type: maybe-inexact-number)
-Daytime screen brightness, between 0.1 and 1.0.
+@item @code{daytime-brightness} (type: maybe-inexact-number)
+Daytime screen brightness, between 0.1 and 1.0, or left unspecified.
 
-@item @code{nighttime-brightness} (default: @code{disabled}) (type: maybe-inexact-number)
-Nighttime screen brightness, between 0.1 and 1.0.
+@item @code{nighttime-brightness} (type: maybe-inexact-number)
+Nighttime screen brightness, between 0.1 and 1.0, or left unspecified.
 
-@item @code{latitude} (default: @code{disabled}) (type: maybe-inexact-number)
+@item @code{latitude} (type: maybe-inexact-number)
 Latitude, when @code{location-provider} is @code{'manual}.
 
-@item @code{longitude} (default: @code{disabled}) (type: maybe-inexact-number)
+@item @code{longitude} (type: maybe-inexact-number)
 Longitude, when @code{location-provider} is @code{'manual}.
 
-@item @code{dawn-time} (default: @code{disabled}) (type: maybe-string)
+@item @code{dawn-time} (type: maybe-string)
 Custom time for the transition from night to day in the
 morning---@code{"HH:MM"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.
 
-@item @code{dusk-time} (default: @code{disabled}) (type: maybe-string)
+@item @code{dusk-time} (type: maybe-string)
 Likewise, custom time for the transition from day to night in the
 evening.
 
-- 
2.35.1





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 23 Apr 2022 14:55:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 23 10:55:36 2022
Received: from localhost ([127.0.0.1]:56976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1niHAd-0005ZT-Q5
	for submit <at> debbugs.gnu.org; Sat, 23 Apr 2022 10:55:36 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:58048)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1niHAb-0005ZK-Cf
 for 54674 <at> debbugs.gnu.org; Sat, 23 Apr 2022 10:55:33 -0400
Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a])
 by albert.telenet-ops.be with bizsmtp
 id NEvX270074UW6Th06EvX7M; Sat, 23 Apr 2022 16:55:31 +0200
Message-ID: <813b73d348bd7de3e19573f5e4261da2120711c0.camel@HIDDEN>
Subject: Re: [bug#54674] [PATCH v4 1/2] services: configuration: Support
 (field1 maybe-number "") format.
From: Maxime Devos <maximedevos@HIDDEN>
To: Attila Lendvai <attila@HIDDEN>, 54674 <at> debbugs.gnu.org
Date: Sat, 23 Apr 2022 16:55:31 +0200
In-Reply-To: <20220420091553.26732-1-attila@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
 <20220420091553.26732-1-attila@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-ebzziRVvDO+3/c42eNdo"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1650725732; bh=avU+veIlGlXxdsKwvOGIVOgo2/qRkvDvq/5xbFEacdI=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=TNI0bP4hrAZwnCa+yBjspfQp3SqCRexRlqpLEVVO64ClUhdDvj5gkHB6nHj4S1Kxo
 1eaiyY9yZmuJhYym/7X/ixgRXxusJgCrvXZbUHRZMi1KFD4fiaVR5C0MuL95WsJEES
 i3wLn56yLxSVAqHgf9UT98U0efA0Ek9dJVqV6Gd1Nr1aHx4I0HCTLINzXd11Bgh7fz
 1dEzn8QlAW5XaIRkBYpd9tBuWQ0kP6Q2gRYTVMktIehpG3MR0O8iSZ6OXDiKInI3Bm
 sTSvfHioB0IMNS5uR/FTdsjgXDxBhY3YjIjBxVIQugvrEYrhJOo1lqRUdYk1RPx0Rz
 EgR6Hs9dGa5Ng==
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--=-ebzziRVvDO+3/c42eNdo
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I didn't look into the code in detail, but for this kind of thing,
if it compiles, it probably works.  For completeness, you might want to
run a few system tests (=E2=80=98make check-system=E2=80=99 IIRC).

However, ...

Attila Lendvai schreef op wo 20-04-2022 om 11:15 [+0200]:
> As opposed to explicitly using 'disabled as value, or using the
> (field1 (maybe-number) "") format.
>=20
> It's mostly the work of Maxime Devos shared under #54674, with some
> modifications by Attila Lendvai.
>=20
> * gnu/services/configuration.scm (normalize-field-type+def): New function=
.
> (define-configuration-helper) (define-configuration): Support new field
> format.
> * tests/services/configuration.scm (config-with-maybe-number->string): Ne=
w
> function.
> ("maybe value serialization of the instance"): New test.
> ("maybe value serialization of the instance, unspecified"): New test.

... 'define-configuration' and 'disabled' is documented in the manual
(guix)Complex Configurations:

     When defining a =E2=80=9Cmaybe type=E2=80=9D, the corresponding serial=
izer for the
     regular type will be used by default.  For example, a field of
     type =E2=80=98maybe-string=E2=80=99 will be serialized using the
     =E2=80=98serialize-string=E2=80=99 procedure by default, you can of co=
urse change
     this by specifying a custom serializer procedure.  Likewise, the
     type of the value would have to be a string, unless it is set to
     the =E2=80=98disabled=E2=80=99 symbol.

It also appears in other locations in the documentation:

     =E2=80=98daytime-brightness=E2=80=99 (default: =E2=80=98disabled=E2=80=
=99) (type: maybe-inexact-number)
          Daytime screen brightness, between 0.1 and 1.0.

   The available configuration parameters follow.  Each parameter
definition is preceded by its type; for example, =E2=80=98string-list foo=
=E2=80=99
indicates that the =E2=80=98foo=E2=80=99 parameter should be specified as a=
 list of
strings.  Types starting with =E2=80=98maybe-=E2=80=99 denote parameters th=
at won=E2=80=99t show
up in =E2=80=98prosody.cfg.lua=E2=80=99 when their value is =E2=80=98'disab=
led=E2=80=99.

     [...]

So the documentation appears to be needed to be changed as well.

Greetings,
Maxime.

--=-ebzziRVvDO+3/c42eNdo
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYmQTYxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mIUAQDFuL+3LYJEbYvQSkmLu4z1kwjz
LsD+us5fzeWQk2Hu0QD/aGbHFKHxpWBiCsqmNi7Wwz5rOTdMiyiqZAVT2VrW2gQ=
=Pbj/
-----END PGP SIGNATURE-----

--=-ebzziRVvDO+3/c42eNdo--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 20 Apr 2022 09:17:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 20 05:17:36 2022
Received: from localhost ([127.0.0.1]:45078 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nh6St-0006YP-5s
	for submit <at> debbugs.gnu.org; Wed, 20 Apr 2022 05:17:36 -0400
Received: from mail-ed1-f53.google.com ([209.85.208.53]:43717)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1nh6Sq-0006Xz-JQ
 for 54674 <at> debbugs.gnu.org; Wed, 20 Apr 2022 05:17:34 -0400
Received: by mail-ed1-f53.google.com with SMTP id b24so1423518edu.10
 for <54674 <at> debbugs.gnu.org>; Wed, 20 Apr 2022 02:17:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=wfLv5/A0m+9FmGQ38yO1ds6uHgd/Gyz/oeJYLsuGElo=;
 b=ha8jieNiAS2KgZGSSkWOK6CJbgXg1czY0AZO2uW4VAzUAnVVrrOfpUxytL/n+zdhxV
 0WuDuAsqPatcdgqbaLKtNgk1vObWMh27p/oYCylv8rDZALSQ8XZnOYEjHE4e9PeIhop2
 mBz9D5hJ4c9SNczSzbIMTklN08sY/2zZf/Dcnh/nLTopMg0KGc8zrP6YPjI+MP+WFbZq
 qN1TcPZDKzFH9Url45J7kD46fFkSLIRPVVBsQ5kz09GWrPqq+9OSa9UySxaMXlgB/A7z
 /uMgvc69N9hq9TNPPM87o25GeidunuyXDfIIrfJeY7ZOj2qq7JZ5RabRLQ1R6pvMNCAG
 zHXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=wfLv5/A0m+9FmGQ38yO1ds6uHgd/Gyz/oeJYLsuGElo=;
 b=JkzCe/LjahOGFOq26l3vPgc/HOESE2jO+aaSHwB6pemFpRZcMgfndTVXKEUWpag4F6
 OuaISAfXqNAitpOC7X+NTvfC62WUvRoVfzFrQJxhyXbPpVDnp/l6aAUxmDEuCnD+p/rp
 ffkKOiqzEvlvnb0sy8MtxzuK6UWQ9sKeGV/96wf/t3ujKoOUEe0JtessV1z6MlRHOdS6
 ChMYEOZy9dBCZIVgq8lQ153AG+dDXkWcd7GwjWHFXPUtWEFLlrGAImSIAYovvTOMbt3N
 MMTboFypG2DxikHkInFSUejIN7BSw9ClQOl4VqPWpdvwfqssgIayZ0IOlXuMy+IzDSsN
 r/hA==
X-Gm-Message-State: AOAM5319ftmUaIHFaFjFbofGD4K7nl7Nr+3vSC3oa0asiBe1x524m59r
 AIPf4FqbDkJ3Pjxm5+p40Uk0uVytJFs=
X-Google-Smtp-Source: ABdhPJwX5GRs8VrQuJH6LObxjJ5F2RCHwrs+6++K8nPqHzs2yFcN+SPEJoSS+63J6e20G1yQOYNU6w==
X-Received: by 2002:a05:6402:218:b0:419:d804:9483 with SMTP id
 t24-20020a056402021800b00419d8049483mr22559594edv.396.1650446246148; 
 Wed, 20 Apr 2022 02:17:26 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 n25-20020aa7db59000000b00415965e9727sm9598101edt.18.2022.04.20.02.17.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 20 Apr 2022 02:17:25 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v4 2/2] services: configuration: Use *unspecified* instead of
 'disabled.
Date: Wed, 20 Apr 2022 11:15:55 +0200
Message-Id: <20220420091553.26732-2-attila@HIDDEN>
X-Mailer: git-send-email 2.35.1
In-Reply-To: <20220420091553.26732-1-attila@HIDDEN>
References: <20220420091553.26732-1-attila@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Use *unspecified* as a marker for field values that have not been set.

Rationale: 'disabled may easily clash with user values for boolean fields, is
confusing (i.e. its meaning is *not* boolean false, but unspecified) and it
also passes silently through the symbol? predicate of a field of type symbol.

* gnu/services/configuration.scm (configuration-missing-default-value):
Renamed from configuration-no-default-value.
* gnu/services/configuration.scm (define-maybe-helper): Use *unspecified*
instead of 'disabled, and make the default value optional.
* tests/services/configuration.scm ("maybe type, no default")
("maybe type, with default"): New tests.
---
 gnu/home/services/desktop.scm    | 12 ++---
 gnu/services/authentication.scm  | 82 ++++++++++++++++----------------
 gnu/services/cgit.scm            | 12 ++---
 gnu/services/configuration.scm   | 17 ++++---
 gnu/services/file-sharing.scm    | 24 +++++-----
 gnu/services/messaging.scm       | 37 +++++++-------
 gnu/services/networking.scm      | 12 ++---
 gnu/services/pm.scm              | 54 ++++++++++-----------
 gnu/services/telephony.scm       | 14 +++---
 gnu/services/vpn.scm             |  2 +-
 tests/services/configuration.scm | 12 +++++
 11 files changed, 144 insertions(+), 134 deletions(-)

diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm
index cbb9cf76da..b0f4d969b0 100644
--- a/gnu/home/services/desktop.scm
+++ b/gnu/home/services/desktop.scm
@@ -91,26 +91,26 @@ (define-configuration home-redshift-configuration
    "Nighttime color temperature (kelvins).")
 
   (daytime-brightness
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Daytime screen brightness, between 0.1 and 1.0.")
   (nighttime-brightness
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Nighttime screen brightness, between 0.1 and 1.0.")
 
   (latitude
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Latitude, when @code{location-provider} is @code{'manual}.")
   (longitude
-   (maybe-inexact-number 'disabled)
+   maybe-inexact-number
    "Longitude, when @code{location-provider} is @code{'manual}.")
 
   (dawn-time
-   (maybe-string 'disabled)
+   maybe-string
    "Custom time for the transition from night to day in the
 morning---@code{\"HH:MM\"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.")
   (dusk-time
-   (maybe-string 'disabled)
+   maybe-string
    "Likewise, custom time for the transition from day to night in the
 evening.")
 
diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm
index cb0ef6d85a..f7becdfafb 100644
--- a/gnu/services/authentication.scm
+++ b/gnu/services/authentication.scm
@@ -218,7 +218,7 @@ (define-configuration nslcd-configuration
 
   ;; Runtime options
   (threads
-   (maybe-number 'disabled)
+   maybe-number
    "The number of threads to start that can handle requests and perform LDAP
 queries.  Each thread opens a separate connection to the LDAP server.  The
 default is to start 5 threads.")
@@ -243,45 +243,45 @@ (define-configuration nslcd-configuration
    "The list of LDAP server URIs.  Normally, only the first server will be
 used with the following servers as fall-back.")
   (ldap-version
-   (maybe-string 'disabled)
+   maybe-string
    "The version of the LDAP protocol to use.  The default is to use the
 maximum version supported by the LDAP library.")
   (binddn
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the distinguished name with which to bind to the directory
 server for lookups.  The default is to bind anonymously.")
   (bindpw
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the credentials with which to bind.  This option is only
 applicable when used with binddn.")
   (rootpwmoddn
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the distinguished name to use when the root user tries to modify
 a user's password using the PAM module.")
   (rootpwmodpw
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the credentials with which to bind if the root user tries to
 change a user's password.  This option is only applicable when used with
 rootpwmoddn")
 
   ;; SASL authentication options
   (sasl-mech
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the SASL mechanism to be used when performing SASL
 authentication.")
   (sasl-realm
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the SASL realm to be used when performing SASL authentication.")
   (sasl-authcid
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the authentication identity to be used when performing SASL
 authentication.")
   (sasl-authzid
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the authorization identity to be used when performing SASL
 authentication.")
   (sasl-canonicalize?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Determines whether the LDAP server host name should be canonicalised.  If
 this is enabled the LDAP library will do a reverse host name lookup.  By
 default, it is left up to the LDAP library whether this check is performed or
@@ -289,7 +289,7 @@ (define-configuration nslcd-configuration
 
   ;; Kerberos authentication options
   (krb5-ccname
-   (maybe-string 'disabled)
+   maybe-string
    "Set the name for the GSS-API Kerberos credentials cache.")
 
   ;; Search / mapping options
@@ -302,11 +302,11 @@ (define-configuration nslcd-configuration
 default scope is subtree; base scope is almost never useful for name service
 lookups; children scope is not supported on all servers.")
   (deref
-   (maybe-deref-option 'disabled)
+   maybe-deref-option
    "Specifies the policy for dereferencing aliases.  The default policy is to
 never dereference aliases.")
   (referrals
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Specifies whether automatic referral chasing should be enabled.  The
 default behaviour is to chase referrals.")
   (maps
@@ -322,132 +322,132 @@ (define-configuration nslcd-configuration
 
   ;; Timing / reconnect options
   (bind-timelimit
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the time limit in seconds to use when connecting to the
 directory server.  The default value is 10 seconds.")
   (timelimit
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the time limit (in seconds) to wait for a response from the LDAP
 server.  A value of zero, which is the default, is to wait indefinitely for
 searches to be completed.")
   (idle-timelimit
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the period if inactivity (in seconds) after which the con‐
 nection to the LDAP server will be closed.  The default is not to time out
 connections.")
   (reconnect-sleeptime
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the number of seconds to sleep when connecting to all LDAP
 servers fails.  By default one second is waited between the first failure and
 the first retry.")
   (reconnect-retrytime
-   (maybe-number 'disabled)
+   maybe-number
    "Specifies the time after which the LDAP server is considered to be
 permanently unavailable.  Once this time is reached retries will be done only
 once per this time period.  The default value is 10 seconds.")
 
   ;; TLS options
   (ssl
-   (maybe-ssl-option 'disabled)
+   maybe-ssl-option
    "Specifies whether to use SSL/TLS or not (the default is not to).  If
 'start-tls is specified then StartTLS is used rather than raw LDAP over SSL.")
   (tls-reqcert
-   (maybe-tls-reqcert-option 'disabled)
+   maybe-tls-reqcert-option
    "Specifies what checks to perform on a server-supplied certificate.
 The meaning of the values is described in the ldap.conf(5) manual page.")
   (tls-cacertdir
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the directory containing X.509 certificates for peer authen‐
 tication.  This parameter is ignored when using GnuTLS.")
   (tls-cacertfile
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to the X.509 certificate for peer authentication.")
   (tls-randfile
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to an entropy source.  This parameter is ignored when
 using GnuTLS.")
   (tls-ciphers
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the ciphers to use for TLS as a string.")
   (tls-cert
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to the file containing the local certificate for client
 TLS authentication.")
   (tls-key
-   (maybe-string 'disabled)
+   maybe-string
    "Specifies the path to the file containing the private key for client TLS
 authentication.")
 
   ;; Other options
   (pagesize
-   (maybe-number 'disabled)
+   maybe-number
    "Set this to a number greater than 0 to request paged results from the LDAP
 server in accordance with RFC2696.  The default (0) is to not request paged
 results.")
   (nss-initgroups-ignoreusers
-   (maybe-ignore-users-option 'disabled)
+   maybe-ignore-users-option
    "This option prevents group membership lookups through LDAP for the
 specified users.  Alternatively, the value 'all-local may be used.  With that
 value nslcd builds a full list of non-LDAP users on startup.")
   (nss-min-uid
-   (maybe-number 'disabled)
+   maybe-number
    "This option ensures that LDAP users with a numeric user id lower than the
 specified value are ignored.")
   (nss-uid-offset
-   (maybe-number 'disabled)
+   maybe-number
    "This option specifies an offset that is added to all LDAP numeric user
 ids.  This can be used to avoid user id collisions with local users.")
   (nss-gid-offset
-   (maybe-number 'disabled)
+   maybe-number
    "This option specifies an offset that is added to all LDAP numeric group
 ids.  This can be used to avoid user id collisions with local groups.")
   (nss-nested-groups
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "If this option is set, the member attribute of a group may point to
 another group.  Members of nested groups are also returned in the higher level
 group and parent groups are returned when finding groups for a specific user.
 The default is not to perform extra searches for nested groups.")
   (nss-getgrent-skipmembers
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "If this option is set, the group member list is not retrieved when looking
 up groups.  Lookups for finding which groups a user belongs to will remain
 functional so the user will likely still get the correct groups assigned on
 login.")
   (nss-disable-enumeration
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "If this option is set, functions which cause all user/group entries to be
 loaded from the directory will not succeed in doing so.  This can dramatically
 reduce LDAP server load in situations where there are a great number of users
 and/or groups.  This option is not recommended for most configurations.")
   (validnames
-   (maybe-string 'disabled)
+   maybe-string
    "This option can be used to specify how user and group names are verified
 within the system.  This pattern is used to check all user and group names
 that are requested and returned from LDAP.")
   (ignorecase
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "This specifies whether or not to perform searches using case-insensitive
 matching.  Enabling this could open up the system to authorization bypass
 vulnerabilities and introduce nscd cache poisoning vulnerabilities which allow
 denial of service.")
   (pam-authc-ppolicy
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "This option specifies whether password policy controls are requested and
 handled from the LDAP server when performing user authentication.")
   (pam-authc-search
-   (maybe-string 'disabled)
+   maybe-string
    "By default nslcd performs an LDAP search with the user's credentials after
 BIND (authentication) to ensure that the BIND operation was successful.  The
 default search is a simple check to see if the user's DN exists.  A search
 filter can be specified that will be used instead.  It should return at least
 one entry.")
   (pam-authz-search
-   (maybe-string 'disabled)
+   maybe-string
    "This option allows flexible fine tuning of the authorisation check that
 should be performed.  The search filter specified is executed and if any
 entries match, access is granted, otherwise access is denied.")
   (pam-password-prohibit-message
-   (maybe-string 'disabled)
+   maybe-string
    "If this option is set password modification using pam_ldap will be denied
 and the specified message will be presented to the user instead.  The message
 can be used to direct the user to an alternative means of changing their
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bfc89a40a4..c2c003983a 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -241,27 +241,27 @@ (define-configuration repository-cgit-configuration
    (repo-file-object "")
    "Override the default @code{email-filter}.")
   (enable-commit-graph?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.")
   (enable-log-filecount?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.")
   (enable-log-linecount?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.")
   (enable-remote-branches?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.")
   (enable-subject-links?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to override the global setting
 @code{enable-subject-links?}.")
   (enable-html-serving?
-   (maybe-repo-boolean 'disabled)
+   maybe-repo-boolean
    "A flag which can be used to override the global setting
 @code{enable-html-serving?}.")
   (hide?
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index bdca33ed68..f6b20fb82b 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -93,7 +93,7 @@ (define (configuration-field-error field val)
 (define (configuration-missing-field kind field)
   (configuration-error
    (format #f "~a configuration missing required field ~a" kind field)))
-(define (configuration-no-default-value kind field)
+(define (configuration-missing-default-value kind field)
   (configuration-error
    (format #f "The field `~a' of the `~a' configuration record \
 does not have a default value" field kind)))
@@ -142,7 +142,8 @@ (define (define-maybe-helper serialize? prefix syn)
                                     (id #'stem #'serialize-maybe- #'stem))))
        #`(begin
            (define (maybe-stem? val)
-             (or (eq? val 'disabled) (stem? val)))
+             (or (unspecified? val)
+                 (stem? val)))
            #,@(if serialize?
                   (list #'(define (serialize-maybe-stem field-name val)
                             (if (stem? val)
@@ -170,10 +171,10 @@ (define (normalize-field-type+def s)
      (values #'(field-type def)))
     ((field-type)
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))
+     (values #'(field-type *unspecified*)))
     (field-type
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))))
+     (values #'(field-type *unspecified*)))))
 
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
@@ -219,9 +220,7 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
                                           source-properties->location))
                           (innate))
                #,@(map (lambda (name getter def)
-                         (if (eq? (syntax->datum def) (quote 'undefined))
-                             #`(#,name #,getter)
-                             #`(#,name #,getter (default #,def))))
+                         #`(#,name #,getter (default #,def)))
                        #'(field ...)
                        #'(field-getter ...)
                        #'(field-default ...)))
@@ -236,8 +235,8 @@ (define #,(id #'stem #'stem #'-fields)
                         (lambda ()
                           (display '#,(id #'stem #'% #'stem))
                           (if (eq? (syntax->datum field-default)
-                                   'undefined)
-                              (configuration-no-default-value
+                                   '*unspecified*)
+                              (configuration-missing-default-value
                                '#,(id #'stem #'% #'stem) 'field)
                               field-default)))
                       (documentation doc))
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index e3d681b08f..e32d1f145d 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -115,8 +115,7 @@ (define-maybe string)
 (set! serialize-maybe-string
   (lambda (field-name val)
     (serialize-string field-name
-                      (if (and (symbol? val)
-                               (eq? val 'disabled))
+                      (if (unspecified? val)
                           ""
                           val))))
 
@@ -181,8 +180,7 @@ (define (serialize-file-object field-name val)
 (define-maybe file-object)
 (set! serialize-maybe-file-object
   (lambda (field-name val)
-    (if (and (symbol? val)
-             (eq? val 'disabled))
+    (if (unspecified? val)
         (serialize-string field-name "")
         (serialize-file-object field-name val))))
 
@@ -281,7 +279,7 @@ (define-configuration transmission-daemon-configuration
 torrent is complete.  Otherwise, files for all torrents (including those still
 being downloaded) will be placed in @code{download-dir}.")
   (incomplete-dir
-   (maybe-string 'disabled)
+   maybe-string
    "The directory in which files from incompletely downloaded torrents will be
 held when @code{incomplete-dir-enabled?} is @code{#t}.")
   (umask
@@ -305,7 +303,7 @@ (define-configuration transmission-daemon-configuration
 automatically (and the original files removed, if
 @code{trash-original-torrent-files?} is @code{#t}).")
   (watch-dir
-   (maybe-string 'disabled)
+   maybe-string
    "The directory to be watched for @file{.torrent} files indicating new
 torrents to be added, when @code{watch-dir-enabled} is @code{#t}.")
   (trash-original-torrent-files?
@@ -401,11 +399,11 @@ (define-configuration transmission-daemon-configuration
 @code{prefer-unencrypted-connections}, @code{prefer-encrypted-connections} or
 @code{require-encrypted-connections}.")
   (peer-congestion-algorithm
-   (maybe-string 'disabled)
+   maybe-string
    "The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt} (or leave it unset, in which case the operating-system
+default is used).
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -465,7 +463,7 @@ (define-configuration transmission-daemon-configuration
    "When @code{#t}, the daemon will ignore peers mentioned in the blocklist it
 has most recently downloaded from @code{blocklist-url}.")
   (blocklist-url
-   (maybe-string 'disabled)
+   maybe-string
    "The URL of a peer blocklist (in @acronym{P2P}-plaintext or eMule
 @file{.dat} format) to be periodically downloaded and applied when
 @code{blocklist-enabled?} is @code{#t}.")
@@ -564,11 +562,11 @@ (define-configuration transmission-daemon-configuration
 the side effect of disabling host-name whitelisting (see
 @code{rpc-host-whitelist-enabled?}.")
   (rpc-username
-   (maybe-string 'disabled)
+   maybe-string
    "The username required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.")
   (rpc-password
-   (maybe-transmission-password-hash 'disabled)
+   maybe-transmission-password-hash
    "The password required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.  This must be specified
 using a password hash in the format recognized by Transmission clients, either
@@ -613,7 +611,7 @@ (define-configuration transmission-daemon-configuration
 @code{script-torrent-done-filename} will be invoked each time a torrent
 completes.")
   (script-torrent-done-filename
-   (maybe-file-object 'disabled)
+   maybe-file-object
    "A file name or file-like object specifying a script to run each time a
 torrent completes, when @code{script-torrent-done-enabled?} is @code{#t}.")
   (scrape-paused-torrents-enabled?
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 4bceb1d37a..f8d2c3707a 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -72,6 +72,7 @@ (define (make-pred arg)
       (lambda (field target)
         (and (memq (syntax->datum target) `(common ,arg)) field)))
     (syntax-case stx ()
+      ;; TODO Also handle (field-type) form, without a default.
       ((_ stem (field (field-type def) doc target) ...)
        (with-syntax (((new-field-type ...)
                       (map (lambda (field-type target)
@@ -85,7 +86,7 @@ (define (make-pred arg)
                      ((new-def ...)
                       (map (lambda (def target)
                              (if (eq? 'common (syntax->datum target))
-                                 #''disabled def))
+                                 #'*unspecified* def))
                            #'(def ...) #'(target ...)))
                      ((new-doc ...)
                       (map (lambda (doc target)
@@ -195,7 +196,7 @@ (define (serialize-file-object-list field-name val)
 (define-maybe file-object-list)
 
 (define (raw-content? val)
-  (not (eq? val 'disabled)))
+  (not (unspecified? val)))
 (define (serialize-raw-content field-name val)
   val)
 (define-maybe raw-content)
@@ -223,15 +224,15 @@ (define-maybe mod-muc-configuration)
 
 (define-configuration ssl-configuration
   (protocol
-   (maybe-string 'disabled)
+   maybe-string
    "This determines what handshake to use.")
 
   (key
-   (maybe-file-name 'disabled)
+   maybe-file-name
    "Path to your private key file.")
 
   (certificate
-   (maybe-file-name 'disabled)
+   maybe-file-name
    "Path to your certificate file.")
 
   (capath
@@ -240,48 +241,48 @@ (define-configuration ssl-configuration
 trust when verifying the certificates of remote servers.")
 
   (cafile
-   (maybe-file-object 'disabled)
+   maybe-file-object
    "Path to a file containing root certificates that you wish Prosody to trust.
 Similar to @code{capath} but with all certificates concatenated together.")
 
   (verify
-   (maybe-string-list 'disabled)
+   maybe-string-list
    "A list of verification options (these mostly map to OpenSSL's
 @code{set_verify()} flags).")
 
   (options
-   (maybe-string-list 'disabled)
+   maybe-string-list
    "A list of general options relating to SSL/TLS.  These map to OpenSSL's
 @code{set_options()}.  For a full list of options available in LuaSec, see the
 LuaSec source.")
 
   (depth
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "How long a chain of certificate authorities to check when looking for a
 trusted root certificate.")
 
   (ciphers
-   (maybe-string 'disabled)
+   maybe-string
    "An OpenSSL cipher string.  This selects what ciphers Prosody will offer to
 clients, and in what order.")
 
   (dhparam
-   (maybe-file-name 'disabled)
+   maybe-file-name
    "A path to a file containing parameters for Diffie-Hellman key exchange.  You
 can create such a file with:
 @code{openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048}")
 
   (curve
-   (maybe-string 'disabled)
+   maybe-string
    "Curve for Elliptic curve Diffie-Hellman. Prosody's default is
 @samp{\"secp384r1\"}.")
 
   (verifyext
-   (maybe-string-list 'disabled)
+   maybe-string-list
    "A list of \"extra\" verification options.")
 
   (password
-   (maybe-string 'disabled)
+   maybe-string
    "Password for encrypted private keys."))
 (define (serialize-ssl-configuration field-name val)
   #~(format #f "ssl = {\n~a};\n"
@@ -469,12 +470,12 @@ (define-all-configurations prosody-configuration
      global)
 
     (http-max-content-size
-     (maybe-non-negative-integer 'disabled)
+     (maybe-non-negative-integer *unspecified*)
      "Maximum allowed size of the HTTP body (in bytes)."
      common)
 
     (http-external-url
-     (maybe-string 'disabled)
+     (maybe-string *unspecified*)
      "Some modules expose their own URL in various ways.  This URL is built
 from the protocol, host and port used.  If Prosody sits behind a proxy, the
 public URL will be @code{http-external-url} instead.  See
@@ -551,7 +552,7 @@ (define-all-configurations prosody-configuration
      int-component)
 
     (mod-muc
-     (maybe-mod-muc-configuration 'disabled)
+     (maybe-mod-muc-configuration *unspecified*)
      "Multi-user chat (MUC) is Prosody's module for allowing you to create
 hosted chatrooms/conferences for XMPP users.
 
@@ -568,7 +569,7 @@ (define-all-configurations prosody-configuration
      ext-component)
 
     (raw-content
-     (maybe-raw-content 'disabled)
+     (maybe-raw-content *unspecified*)
      "Raw content that will be added to the configuration file."
      common)))
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5bb8638930..e7fdac94e2 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -763,17 +763,17 @@ (define-configuration/no-serialization opendht-configuration
    "The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the @code{:PORT}
 suffix.  By default, it uses the Jami bootstrap nodes, but any host can be
-specified here.  It's also possible to disable bootstrapping by setting this
-to the @code{'disabled} symbol.")
+specified here.  It's also possible to disable bootstrapping by explicitly
+setting this field to the @code{*unspecified*} value.")
   (port
    (maybe-number 4222)
-   "The UDP port to bind to.  When set to @code{'disabled}, an available port
-is automatically selected.")
+   "The UDP port to bind to.  When set to @code{*unspecified*}, an available
+port is automatically selected.")
   (proxy-server-port
-   (maybe-number 'disabled)
+   maybe-number
    "Spawn a proxy server listening on the specified port.")
   (proxy-server-port-tls
-   (maybe-number 'disabled)
+   maybe-number
    "Spawn a proxy server listening to TLS connections on the specified
 port."))
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index e48236dbca..3daf484cc1 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -114,55 +114,55 @@ (define-configuration tlp-configuration
    "Same as @code{max-lost-work-secs-on-ac} but on BAT mode.")
 
   (cpu-scaling-governor-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "CPU frequency scaling governor on AC mode.  With intel_pstate
 driver, alternatives are powersave and performance.  With acpi-cpufreq driver,
 alternatives are ondemand, powersave, performance and conservative.")
 
   (cpu-scaling-governor-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Same as @code{cpu-scaling-governor-on-ac} but on BAT mode.")
 
   (cpu-scaling-min-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the min available frequency for the scaling governor on AC.")
 
   (cpu-scaling-max-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the max available frequency for the scaling governor on AC.")
 
   (cpu-scaling-min-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the min available frequency for the scaling governor on BAT.")
 
   (cpu-scaling-max-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Set the max available frequency for the scaling governor on BAT.")
 
   (cpu-min-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Limit the min P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-max-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Limit the max P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-min-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Same as @code{cpu-min-perf-on-ac} on BAT mode.")
 
   (cpu-max-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Same as @code{cpu-max-perf-on-ac} on BAT mode.")
 
   (cpu-boost-on-ac?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Enable CPU turbo boost feature on AC mode.")
 
   (cpu-boost-on-bat?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Same as @code{cpu-boost-on-ac?} on BAT mode.")
 
   (sched-powersave-on-ac?
@@ -179,7 +179,7 @@ (define-configuration tlp-configuration
    "Enable Linux kernel NMI watchdog.")
 
   (phc-controls
-   (maybe-string 'disabled)
+   maybe-string
    "For Linux kernels with PHC patch applied, change CPU voltages.
 An example value would be @samp{\"F:V F:V F:V F:V\"}.")
 
@@ -205,16 +205,16 @@ (define-configuration tlp-configuration
    "Same as @code{disk-apm-bat} but on BAT mode.")
 
   (disk-spindown-timeout-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Hard disk spin down timeout.  One value has to be specified for
 each declared hard disk.")
 
   (disk-spindown-timeout-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Same as @code{disk-spindown-timeout-on-ac} but on BAT mode.")
 
   (disk-iosched
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Select IO scheduler for disk devices.  One value has to be specified
 for each declared hard disk.  Example alternatives are cfq, deadline and noop.")
 
@@ -228,16 +228,16 @@ (define-configuration tlp-configuration
    "Same as @code{sata-linkpwr-ac} but on BAT mode.")
 
   (sata-linkpwr-blacklist
-   (maybe-string 'disabled)
+   maybe-string
    "Exclude specified SATA host devices for link power management.")
 
   (ahci-runtime-pm-on-ac?
-   (maybe-on-off-boolean 'disabled)
+   maybe-on-off-boolean
    "Enable Runtime Power Management for AHCI controller and disks
 on AC mode.")
 
   (ahci-runtime-pm-on-bat?
-   (maybe-on-off-boolean 'disabled)
+   maybe-on-off-boolean
    "Same as @code{ahci-runtime-pm-on-ac} on BAT mode.")
 
   (ahci-runtime-pm-timeout
@@ -254,19 +254,19 @@ (define-configuration tlp-configuration
    "Same as @code{pcie-aspm-ac} but on BAT mode.")
 
   (start-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 0 should begin charging.")
 
   (stop-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 0 should stop charging.")
 
   (start-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 1 should begin charging.")
 
   (stop-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   maybe-non-negative-integer
    "Percentage when battery 1 should stop charging.")
 
   (radeon-power-profile-on-ac
@@ -346,7 +346,7 @@ (define-configuration tlp-configuration
 blacklisted ones.")
 
   (runtime-pm-blacklist
-   (maybe-space-separated-string-list 'disabled)
+   maybe-space-separated-string-list
    "Exclude specified PCI(e) device addresses from Runtime Power Management.")
 
   (runtime-pm-driver-blacklist
@@ -359,7 +359,7 @@ (define-configuration tlp-configuration
    "Enable USB autosuspend feature.")
 
   (usb-blacklist
-   (maybe-string 'disabled)
+   maybe-string
    "Exclude specified devices from USB autosuspend.")
 
   (usb-blacklist-wwan?
@@ -367,12 +367,12 @@ (define-configuration tlp-configuration
    "Exclude WWAN devices from USB autosuspend.")
 
   (usb-whitelist
-   (maybe-string 'disabled)
+   maybe-string
    "Include specified devices into USB autosuspend, even if they are
 already excluded by the driver or via @code{usb-blacklist-wwan?}.")
 
   (usb-autosuspend-disable-on-shutdown?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Enable USB autosuspend before shutdown.")
 
   (restore-device-state-on-startup?
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index d8ebc7b39d..1ccf060762 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -156,7 +156,7 @@ (define-configuration jami-account
 secret key material of the Jami account it contains."
    empty-serializer)
   (allowed-contacts
-   (maybe-account-fingerprint-list 'disabled)
+   maybe-account-fingerprint-list
    "The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in that list
 will be rejected.  When unspecified, the configuration of the account archive
@@ -165,7 +165,7 @@ (define-configuration jami-account
 the account."
    empty-serializer)
   (moderators
-   (maybe-account-fingerprint-list 'disabled)
+   maybe-account-fingerprint-list
    "The list of contacts that should have moderation privileges (to ban, mute,
 etc. other users) in rendezvous conferences, entered as their 40 characters
 long fingerprint.  When unspecified, the configuration of the account archive
@@ -174,24 +174,24 @@ (define-configuration jami-account
    empty-serializer)
   ;; The serializable fields below are to be set with set-account-details.
   (rendezvous-point?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Whether the account should operate in the rendezvous mode.  In this mode,
 all the incoming audio/video calls are mixed into a conference.  When left
 unspecified, the value from the account archive prevails.")
   (peer-discovery?
-   (maybe-boolean 'disabled)
+   maybe-boolean
    "Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful to
 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 'disabled)
+   maybe-string-list
    "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.")
   (name-server-uri
-   (maybe-string 'disabled)
+   maybe-string
    "The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username."))
 
@@ -246,7 +246,7 @@ (define-configuration/no-serialization jami-configuration
    (boolean #f)
    "Whether to force automatic answer to incoming calls.")
   (accounts
-   (maybe-jami-account-list 'disabled)
+   maybe-jami-account-list
    "A list of Jami accounts to be (re-)provisioned every time the Jami daemon
 service starts.  When providing this field, the account directories under
 @file{/var/lib/jami/} are recreated every time the service starts, ensuring a
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index b24e9cffb3..6a6875e70a 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -363,7 +363,7 @@ (define-split-configuration openvpn-client-configuration
 channel to protect against DoS attacks.")
 
    (auth-user-pass
-     (maybe-string 'disabled)
+    maybe-string
      "Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.")
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 0debf8095b..334a1e409b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -136,3 +136,15 @@ (define-configuration config-with-maybe-string/no-serialization
 
 (test-assert "maybe value without serialization no procedure bound"
   (not (defined? 'serialize-maybe-string)))
+
+(test-assert "maybe type, no default"
+  (unspecified?
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization))))
+
+(test-assert "maybe type, with default"
+  (equal?
+   "foo"
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization
+     (name "foo")))))
-- 
2.35.1





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 20 Apr 2022 09:17:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 20 05:17:26 2022
Received: from localhost ([127.0.0.1]:45075 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nh6Sj-0006Xq-Hc
	for submit <at> debbugs.gnu.org; Wed, 20 Apr 2022 05:17:26 -0400
Received: from mail-ej1-f53.google.com ([209.85.218.53]:38466)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1nh6Sh-0006XZ-Ne
 for 54674 <at> debbugs.gnu.org; Wed, 20 Apr 2022 05:17:24 -0400
Received: by mail-ej1-f53.google.com with SMTP id r13so2210245ejd.5
 for <54674 <at> debbugs.gnu.org>; Wed, 20 Apr 2022 02:17:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=+iyFTRtqAtXkgYiGtD4uae6oIfGkmk+wBlwrs0+AIjM=;
 b=KMuRhwgYyduIoiobXGYuRX5dNaZxtSRVs3rYvJgldzS6nKzbi4fg03W6T95n9KHsXZ
 s3cOFkIVQBvFyagkzddoPDHrhdVhBRYklv1lsB59co8e9Ubqvp1U5JKTShvIyux19UEb
 g17JIXXV1FGxoRX9gjLRV7c3pkWFQ5MB6U17/F0lfkweQMBJmL6lejY/ak3b9hb1xS43
 O05N0teCWEnWgm9G1I/BhVr1rOK3e+R2+ZOimtbhJpEYP7DnDiVTFExJpa7EL2J51Xv9
 sBU9780oMKozxh2a1xh4AjYf4Ep9wcYYZu8UhkwcY2oWaYtsBYxBWyZUOub9cBuYIbPI
 AdZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :mime-version:content-transfer-encoding;
 bh=+iyFTRtqAtXkgYiGtD4uae6oIfGkmk+wBlwrs0+AIjM=;
 b=4Vih30GhNSAU8NjIVoUguz0fElhCSqjsJ1ttibcevyqtmW+2tl53S+COwPi61d1yza
 u4un82e2D5i21NPJVXETwq7FESpCJmoPVUuP4HxofhBUbM9ocfnLsQcefisMugmT0vUR
 TQk4vthU+xgxeWZ+SB1DD4TpIeF5ykRrPsRO6YcovFCf9/YKw0K8UDRDPDH1/9Rplalx
 PgBQpDdMxVgn3FbOrHt41ShwinQ/frAbBPA5yuDTWHUII5RrIDUDUIAC3MT05Dt/BDRI
 ds0GdjMGNqNj4/CZS5Qbt6GQzsAH9K4P8fL/QAqSPeBviCqKHliNBJybPFR7IBLBQwwB
 5zRw==
X-Gm-Message-State: AOAM533KxeNUuPh0BsBHZZITzS2+1hMrpK0fSIehDzMEE7UHwQJQeHnj
 meENqQ/OYsNPG9+C8uLkmYhlU8Ne1a0=
X-Google-Smtp-Source: ABdhPJydOQeH8KZol5cGh0hWRFIJ00z1vvyg3htviWKqcVe2ZWIZp1wvzpdoHywCQ5rhX79T/fbyug==
X-Received: by 2002:a17:906:7948:b0:6da:64ed:178e with SMTP id
 l8-20020a170906794800b006da64ed178emr18012513ejo.523.1650446237677; 
 Wed, 20 Apr 2022 02:17:17 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 n25-20020aa7db59000000b00415965e9727sm9598101edt.18.2022.04.20.02.17.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 20 Apr 2022 02:17:17 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v4 1/2] services: configuration: Support (field1 maybe-number
 "") format.
Date: Wed, 20 Apr 2022 11:15:53 +0200
Message-Id: <20220420091553.26732-1-attila@HIDDEN>
X-Mailer: git-send-email 2.35.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.1 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  As opposed to explicitly using 'disabled as value, or using
 the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
 shared under #54674, with some modifications by Attila Lendvai. 
 Content analysis details:   (2.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (attila.lendvai[at]gmail.com)
 1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.218.53 listed in list.dnswl.org]
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [209.85.218.53 listed in wl.mailspike.net]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.1 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  As opposed to explicitly using 'disabled as value, or using
    the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
    shared under #54674, with some modifications by Attila Lendvai. 
 
 Content analysis details:   (1.1 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.218.53 listed in list.dnswl.org]
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [209.85.218.53 listed in wl.mailspike.net]
  0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (attila.lendvai[at]gmail.com)
  1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

As opposed to explicitly using 'disabled as value, or using the
(field1 (maybe-number) "") format.

It's mostly the work of Maxime Devos shared under #54674, with some
modifications by Attila Lendvai.

* gnu/services/configuration.scm (normalize-field-type+def): New function.
(define-configuration-helper) (define-configuration): Support new field
format.
* tests/services/configuration.scm (config-with-maybe-number->string): New
function.
("maybe value serialization of the instance"): New test.
("maybe value serialization of the instance, unspecified"): New test.
---

v4: the only change is to drop the extra parens around the type in
all the (field1 (maybe-foo) "") forms.

 gnu/services/configuration.scm   | 169 +++++++++++++++++--------------
 tests/services/configuration.scm |  28 ++++-
 2 files changed, 114 insertions(+), 83 deletions(-)

diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 0de350a4df..bdca33ed68 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
+;;; Copyright © 2022 Maxime Devos <maximedevos@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -162,78 +163,90 @@ (define-maybe-helper #t #f #'(_ stem))))))
 (define-syntax-rule (define-maybe/no-serialization stem)
   (define-maybe stem (no-serialization)))
 
+(define (normalize-field-type+def s)
+  (syntax-case s ()
+    ((field-type def)
+     (identifier? #'field-type)
+     (values #'(field-type def)))
+    ((field-type)
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))
+    (field-type
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))))
+
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
-    ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
-     (with-syntax (((field-getter ...)
-                    (map (lambda (field)
-                           (id #'stem #'stem #'- field))
-    			 #'(field ...)))
-                   ((field-predicate ...)
-                    (map (lambda (type)
-                           (id #'stem type #'?))
-    			 #'(field-type ...)))
-                   ((field-default ...)
-                    (map (match-lambda
-    			   ((field-type default-value)
-                            default-value)
-    			   ((field-type)
-                            ;; Quote `undefined' to prevent a possibly
-                            ;; unbound warning.
-                            (syntax 'undefined)))
-    			 #'((field-type def ...) ...)))
-                   ((field-serializer ...)
-                    (map (lambda (type custom-serializer)
-                           (and serialize?
-                                (match custom-serializer
-                                  ((serializer)
-                                   serializer)
-                                  (()
-                                   (if serializer-prefix
-                                       (id #'stem
-                                           serializer-prefix
-                                           #'serialize- type)
-                                       (id #'stem #'serialize- type))))))
-                         #'(field-type ...)
-                         #'((custom-serializer ...) ...))))
-       #`(begin
-    	   (define-record-type* #,(id #'stem #'< #'stem #'>)
-    	     #,(id #'stem #'% #'stem)
-    	     #,(id #'stem #'make- #'stem)
-    	     #,(id #'stem #'stem #'?)
-    	     (%location #,(id #'stem #'stem #'-location)
-    			(default (and=> (current-source-location)
-    					source-properties->location))
-    			(innate))
-    	     #,@(map (lambda (name getter def)
-    		       (if (eq? (syntax->datum def) (quote 'undefined))
-    			   #`(#,name #,getter)
-    			   #`(#,name #,getter (default #,def))))
-    		     #'(field ...)
-    		     #'(field-getter ...)
-    		     #'(field-default ...)))
-    	   (define #,(id #'stem #'stem #'-fields)
-    	     (list (configuration-field
-    		    (name 'field)
-    		    (type 'field-type)
-    		    (getter field-getter)
-    		    (predicate field-predicate)
-    		    (serializer field-serializer)
-    		    (default-value-thunk
-    		      (lambda ()
-    			(display '#,(id #'stem #'% #'stem))
-    			(if (eq? (syntax->datum field-default)
-    				 'undefined)
-    			    (configuration-no-default-value
-    			     '#,(id #'stem #'% #'stem) 'field)
-    			    field-default)))
-    		    (documentation doc))
-    		   ...))
-    	   (define-syntax-rule (stem arg (... ...))
-    	     (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
-    	       (validate-configuration conf
-    				       #,(id #'stem #'stem #'-fields))
-    	       conf)))))))
+    ((_ stem (field field-type+def doc custom-serializer ...) ...)
+     (with-syntax
+         ((((field-type def) ...)
+           (map normalize-field-type+def #'(field-type+def ...))))
+       (with-syntax
+           (((field-getter ...)
+             (map (lambda (field)
+                    (id #'stem #'stem #'- field))
+                  #'(field ...)))
+            ((field-predicate ...)
+             (map (lambda (type)
+                    (id #'stem type #'?))
+                  #'(field-type ...)))
+            ((field-default ...)
+             (map (match-lambda
+                    ((field-type default-value)
+                     default-value))
+                  #'((field-type def) ...)))
+            ((field-serializer ...)
+             (map (lambda (type custom-serializer)
+                    (and serialize?
+                         (match custom-serializer
+                           ((serializer)
+                            serializer)
+                           (()
+                            (if serializer-prefix
+                                (id #'stem
+                                    serializer-prefix
+                                    #'serialize- type)
+                                (id #'stem #'serialize- type))))))
+                  #'(field-type ...)
+                  #'((custom-serializer ...) ...))))
+         #`(begin
+             (define-record-type* #,(id #'stem #'< #'stem #'>)
+               #,(id #'stem #'% #'stem)
+               #,(id #'stem #'make- #'stem)
+               #,(id #'stem #'stem #'?)
+               (%location #,(id #'stem #'stem #'-location)
+                          (default (and=> (current-source-location)
+                                          source-properties->location))
+                          (innate))
+               #,@(map (lambda (name getter def)
+                         (if (eq? (syntax->datum def) (quote 'undefined))
+                             #`(#,name #,getter)
+                             #`(#,name #,getter (default #,def))))
+                       #'(field ...)
+                       #'(field-getter ...)
+                       #'(field-default ...)))
+             (define #,(id #'stem #'stem #'-fields)
+               (list (configuration-field
+                      (name 'field)
+                      (type 'field-type)
+                      (getter field-getter)
+                      (predicate field-predicate)
+                      (serializer field-serializer)
+                      (default-value-thunk
+                        (lambda ()
+                          (display '#,(id #'stem #'% #'stem))
+                          (if (eq? (syntax->datum field-default)
+                                   'undefined)
+                              (configuration-no-default-value
+                               '#,(id #'stem #'% #'stem) 'field)
+                              field-default)))
+                      (documentation doc))
+                     ...))
+             (define-syntax-rule (stem arg (... ...))
+               (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
+                 (validate-configuration conf
+                                         #,(id #'stem #'stem #'-fields))
+                 conf))))))))
 
 (define no-serialization         ;syntactic keyword for 'define-configuration'
   '(no serialization))
@@ -241,26 +254,26 @@ (define no-serialization         ;syntactic keyword for 'define-configuration'
 (define-syntax define-configuration
   (lambda (s)
     (syntax-case s (no-serialization prefix)
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem (field field-type+def doc custom-serializer ...) ...
           (no-serialization))
        (define-configuration-helper
-         #f #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #f #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...)))
-      ((_ stem  (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem  (field field-type+def doc custom-serializer ...) ...
           (prefix serializer-prefix))
        (define-configuration-helper
-         #t #'serializer-prefix #'(_ stem (field (field-type def ...)
+         #t #'serializer-prefix #'(_ stem (field field-type+def
                                                  doc custom-serializer ...)
                  ...)))
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
+      ((_ stem (field field-type+def doc custom-serializer ...) ...)
        (define-configuration-helper
-         #t #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #t #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...))))))
 
 (define-syntax-rule (define-configuration/no-serialization
-                      stem (field (field-type def ...)
+                      stem (field field-type+def
                                   doc custom-serializer ...) ...)
-  (define-configuration stem (field (field-type def ...)
+  (define-configuration stem (field field-type+def
                                     doc custom-serializer ...) ...
     (no-serialization)))
 
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 86a36a388d..0debf8095b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -27,6 +27,9 @@ (define-module (tests services configuration)
 
 (test-begin "services-configuration")
 
+(define (serialize-number field value)
+  (format #f "~a=~a" field value))
+
 
 ;;;
 ;;; define-configuration macro.
@@ -47,7 +50,6 @@ (define-configuration port-configuration-cs
   80
   (port-configuration-cs-port (port-configuration-cs)))
 
-(define serialize-number "")
 (define-configuration port-configuration-ndv
   (port (number) "The port number."))
 
@@ -101,15 +103,31 @@ (define-configuration configuration-with-prefix
 (define-maybe number)
 
 (define-configuration config-with-maybe-number
-  (port (maybe-number 80) "The port number."))
-
-(define (serialize-number field value)
-  (format #f "~a=~a" field value))
+  (port  (maybe-number 80) "")
+  (count maybe-number ""))
 
 (test-equal "maybe value serialization"
   "port=80"
   (serialize-maybe-number "port" 80))
 
+(define (config-with-maybe-number->string x)
+  (eval (gexp->approximate-sexp
+         (serialize-configuration x config-with-maybe-number-fields))
+        (current-module)))
+
+(test-equal "maybe value serialization of the instance"
+  "port=42count=43"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42)
+    (count 43))))
+
+(test-equal "maybe value serialization of the instance, unspecified"
+  "port=42"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42))))
+
 (define-maybe/no-serialization string)
 
 (define-configuration config-with-maybe-string/no-serialization
-- 
2.35.1





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 18 Apr 2022 09:27:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 18 05:27:10 2022
Received: from localhost ([127.0.0.1]:38019 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ngNew-0005t0-O8
	for submit <at> debbugs.gnu.org; Mon, 18 Apr 2022 05:27:10 -0400
Received: from mail-4018.proton.ch ([185.70.40.18]:59980)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila@HIDDEN>) id 1ngNet-0005sV-Cs
 for 54674 <at> debbugs.gnu.org; Mon, 18 Apr 2022 05:27:01 -0400
Date: Mon, 18 Apr 2022 09:26:48 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name;
 s=protonmail3; t=1650274012;
 bh=8w5EGrxJrBPr6WNzi4/n5LaWlywChRJV6gyi3DWVSSI=;
 h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To:
 References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID;
 b=TPuOu91w94yH6dVSH1Zb0hAr4zKazXl8IXb4R0S2h7JSlu9PJdE1cx3QXQCCXtbkb
 HRKyDTCVw0hcAYNYRV4VfWxg3RUGAksexOEsP+0MNQuXHp6jkJiKPMDcOueR2cWgVZ
 M/+joy+tPNCXY5i50YDhPVuP+SWW+y27kkZrErYdxYWVbteOo5f29sn7x+7JwYUXcH
 pOFtiPI44O2oLKzE9PqzARQM0iYLXS1LhKzgD0LosLA023KIoB78mcJT9ZWdJv0l+C
 5uRGYBsAtbu3m1IFqODBF5RFpJfO5x7uWW0hQvEDABoQOsXIhzpOUobpyIFphtkMt6
 R8KZlK+JcS4wA==
To: Maxime Devos <maximedevos@HIDDEN>
From: Attila Lendvai <attila@HIDDEN>
Subject: Re: [bug#54674] [PATCH] services: configuration: Use *unspecified*
 instead of 'disabled.
Message-ID: <rA7JQjdYjBC_kIfluPIuWwrkxcSrezhRbdmuIOAw3d01e4m6XtluI3NJmnzS7P3lL9t7t_GTKSEOtPtLdWxN0PQwgCis9p3dMvm192qvCDM=@lendvai.name>
In-Reply-To: <bcaab1bbb79a6cd3d4503f5f57f4ef7eb20cb52f.camel@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
 <2f39bf8cd56b3019026e43532b2f7b937de99b7e.camel@HIDDEN>
 <RyjP_EnJExOZtmPhVCyaItCm7UL0vmEX6dksmALrBGXALN_VruCqiFyWM0MqmBflw_zwb1ZJ97WO4SjbAY_Hn97vgotOpY3bwntDDxkAov0=@lendvai.name>
 <bcaab1bbb79a6cd3d4503f5f57f4ef7eb20cb52f.camel@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54674
Cc: 54674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Attila Lendvai <attila@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

i don't want to be pushy, but some changes that i wish i could publish is h=
eld back by the fate of this patchset (https://github.com/attila-lendvai/gu=
ix-crypto/commits/staging). hence i wish there was some progress on this, a=
nd i'm willing to do whatever may help the process (e.g. writing some more =
tests?).

i'd be satisfied with a simple promise that it's already being investigated=
/tested, or even with a rejection that this is not the right direction and =
it probably won't be accepted. it would be disappointing, but then i could =
refactor my channel to work with the current guix proper codebase and publi=
sh it.

--
=E2=80=A2 attila lendvai
=E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39
--
=E2=80=9CKeep things as simple as you can, but no simpler.=E2=80=9D
=09=E2=80=94 Albert Einstein (1879=E2=80=931955), variations: things/explan=
ation; Einstein/Occam





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 7 Apr 2022 15:12:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 07 11:12:42 2022
Received: from localhost ([127.0.0.1]:33137 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ncToO-0007xO-IG
	for submit <at> debbugs.gnu.org; Thu, 07 Apr 2022 11:12:42 -0400
Received: from mail-ed1-f46.google.com ([209.85.208.46]:43911)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1ncToK-0007x9-W2
 for 54674 <at> debbugs.gnu.org; Thu, 07 Apr 2022 11:12:38 -0400
Received: by mail-ed1-f46.google.com with SMTP id b24so6752436edu.10
 for <54674 <at> debbugs.gnu.org>; Thu, 07 Apr 2022 08:12:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=56onZG+qxdwFMOdilsRdkOuP5PHsnlTqVGnhRv3l3cc=;
 b=NqKR6J6oU4o57nZBR7sKJ7dUF/iPqmzC/oQalDKAcXomXVeNqsyF5/6Ua8Vu0l20Un
 nLkCiidNy2oWWhmdRvOx4F70T/Jh0/MX2tnXqrcksE5MRpvR2r1WDxyVva0aFCwMsc9Y
 G9X5y7uA1QjfqtPQVTWtTST11IDRLlthJFXtKw/E1AVFwCJ/W4i5NFdxDa5S/Vla2Txb
 nnDtpk7WlnWRjLdTm2PJRNe3a8eFrKluiLY/8RzS84oREpKxgQD6ZHz+wy+Tt4OkOV9h
 BeV13PXcr6dwJRE6ekqK9+neJ3Pkn72o5Qs0v6Zj3TmHB6ZVKxroFHnU0lGCa4q/ZdNa
 Hd4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=56onZG+qxdwFMOdilsRdkOuP5PHsnlTqVGnhRv3l3cc=;
 b=LS540VR6JZkNumicD5mFxHvNx+sdWnInb8D4vU5NeaPQiAjh8xnUtRw17e6IhfVWRc
 W2uIxevCNh/pqY04DiLWfKauwAJbA2aJmoTFK7Z0iKEPDgGsIjgbGx6udc7H/5QLiaqZ
 TG/XFcIlYaTPH8UGRVH/aOn6pezUWzyPp4vD4t6QX5nMtXcU5nl5Vn+Amb7B+D43qRVX
 /Ycxw3ghoR3aIFfzBwb2HQFz0F067/rDJLGMOFEt4G50MHYIcgbso9mB3vxFRtAYMJvH
 SeAeyCUqRHemHavpt0VGh2FYIiF9ZEhZYeB3ATy885N4tRE5SrjH3fviN8nvk1tVXlYq
 nq+Q==
X-Gm-Message-State: AOAM533dvlZM9rERrlYmBgqTt5a+ss2QrZIC7OWr0OnsNl5a4uRQQOGA
 Aqgltuk7+0REXhHIdaG6CCSLRat3k08=
X-Google-Smtp-Source: ABdhPJxFePSyOw2jwufZSNccAfQkND+jkU39DArPGOYtCKvIGWWBC8TkwOK1fEJ/saLfxE2R6e2Ufw==
X-Received: by 2002:a05:6402:2812:b0:418:fc32:be18 with SMTP id
 h18-20020a056402281200b00418fc32be18mr14789247ede.357.1649344350632; 
 Thu, 07 Apr 2022 08:12:30 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 h24-20020a170906719800b006e82f0e4060sm956632ejk.205.2022.04.07.08.12.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 07 Apr 2022 08:12:30 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v3 2/2] services: configuration: Use *unspecified* instead of
 'disabled.
Date: Thu,  7 Apr 2022 17:01:42 +0200
Message-Id: <20220407150140.32738-2-attila@HIDDEN>
X-Mailer: git-send-email 2.34.0
In-Reply-To: <20220407150140.32738-1-attila@HIDDEN>
References: <20220407150140.32738-1-attila@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Use it as a marker for field values that have not been set.

Rationale: 'disabled may easily clash with user values for boolean fields, is
confusing (i.e. its meaning is *not* boolean false, but unspecified) and it
also passes through silently the symbol? predicate of a field of type symbol.

* gnu/services/configuration.scm (configuration-missing-default-value):
Renamed from configuration-no-default-value.
* gnu/services/configuration.scm (define-maybe-helper): Use *unspecified*
instead of 'disabled, and make the default value optional.
* tests/services/configuration.scm ("maybe type, no default")
("maybe type, with default"): New tests.
---

v3 cleans up the commit message. the code is not changed.

 gnu/home/services/desktop.scm    | 12 ++---
 gnu/services/authentication.scm  | 82 ++++++++++++++++----------------
 gnu/services/cgit.scm            | 12 ++---
 gnu/services/configuration.scm   | 17 ++++---
 gnu/services/file-sharing.scm    | 24 +++++-----
 gnu/services/messaging.scm       | 37 +++++++-------
 gnu/services/networking.scm      | 12 ++---
 gnu/services/pm.scm              | 54 ++++++++++-----------
 gnu/services/telephony.scm       | 14 +++---
 gnu/services/vpn.scm             |  2 +-
 tests/services/configuration.scm | 12 +++++
 11 files changed, 144 insertions(+), 134 deletions(-)

diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm
index cbb9cf76da..a54ad0d115 100644
--- a/gnu/home/services/desktop.scm
+++ b/gnu/home/services/desktop.scm
@@ -91,26 +91,26 @@ (define-configuration home-redshift-configuration
    "Nighttime color temperature (kelvins).")
 
   (daytime-brightness
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Daytime screen brightness, between 0.1 and 1.0.")
   (nighttime-brightness
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Nighttime screen brightness, between 0.1 and 1.0.")
 
   (latitude
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Latitude, when @code{location-provider} is @code{'manual}.")
   (longitude
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Longitude, when @code{location-provider} is @code{'manual}.")
 
   (dawn-time
-   (maybe-string 'disabled)
+   (maybe-string)
    "Custom time for the transition from night to day in the
 morning---@code{\"HH:MM\"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.")
   (dusk-time
-   (maybe-string 'disabled)
+   (maybe-string)
    "Likewise, custom time for the transition from day to night in the
 evening.")
 
diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm
index cb0ef6d85a..1c4800bfbd 100644
--- a/gnu/services/authentication.scm
+++ b/gnu/services/authentication.scm
@@ -218,7 +218,7 @@ (define-configuration nslcd-configuration
 
   ;; Runtime options
   (threads
-   (maybe-number 'disabled)
+   (maybe-number)
    "The number of threads to start that can handle requests and perform LDAP
 queries.  Each thread opens a separate connection to the LDAP server.  The
 default is to start 5 threads.")
@@ -243,45 +243,45 @@ (define-configuration nslcd-configuration
    "The list of LDAP server URIs.  Normally, only the first server will be
 used with the following servers as fall-back.")
   (ldap-version
-   (maybe-string 'disabled)
+   (maybe-string)
    "The version of the LDAP protocol to use.  The default is to use the
 maximum version supported by the LDAP library.")
   (binddn
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the distinguished name with which to bind to the directory
 server for lookups.  The default is to bind anonymously.")
   (bindpw
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the credentials with which to bind.  This option is only
 applicable when used with binddn.")
   (rootpwmoddn
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the distinguished name to use when the root user tries to modify
 a user's password using the PAM module.")
   (rootpwmodpw
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the credentials with which to bind if the root user tries to
 change a user's password.  This option is only applicable when used with
 rootpwmoddn")
 
   ;; SASL authentication options
   (sasl-mech
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the SASL mechanism to be used when performing SASL
 authentication.")
   (sasl-realm
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the SASL realm to be used when performing SASL authentication.")
   (sasl-authcid
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the authentication identity to be used when performing SASL
 authentication.")
   (sasl-authzid
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the authorization identity to be used when performing SASL
 authentication.")
   (sasl-canonicalize?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Determines whether the LDAP server host name should be canonicalised.  If
 this is enabled the LDAP library will do a reverse host name lookup.  By
 default, it is left up to the LDAP library whether this check is performed or
@@ -289,7 +289,7 @@ (define-configuration nslcd-configuration
 
   ;; Kerberos authentication options
   (krb5-ccname
-   (maybe-string 'disabled)
+   (maybe-string)
    "Set the name for the GSS-API Kerberos credentials cache.")
 
   ;; Search / mapping options
@@ -302,11 +302,11 @@ (define-configuration nslcd-configuration
 default scope is subtree; base scope is almost never useful for name service
 lookups; children scope is not supported on all servers.")
   (deref
-   (maybe-deref-option 'disabled)
+   (maybe-deref-option)
    "Specifies the policy for dereferencing aliases.  The default policy is to
 never dereference aliases.")
   (referrals
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Specifies whether automatic referral chasing should be enabled.  The
 default behaviour is to chase referrals.")
   (maps
@@ -322,132 +322,132 @@ (define-configuration nslcd-configuration
 
   ;; Timing / reconnect options
   (bind-timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time limit in seconds to use when connecting to the
 directory server.  The default value is 10 seconds.")
   (timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time limit (in seconds) to wait for a response from the LDAP
 server.  A value of zero, which is the default, is to wait indefinitely for
 searches to be completed.")
   (idle-timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the period if inactivity (in seconds) after which the con‐
 nection to the LDAP server will be closed.  The default is not to time out
 connections.")
   (reconnect-sleeptime
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the number of seconds to sleep when connecting to all LDAP
 servers fails.  By default one second is waited between the first failure and
 the first retry.")
   (reconnect-retrytime
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time after which the LDAP server is considered to be
 permanently unavailable.  Once this time is reached retries will be done only
 once per this time period.  The default value is 10 seconds.")
 
   ;; TLS options
   (ssl
-   (maybe-ssl-option 'disabled)
+   (maybe-ssl-option)
    "Specifies whether to use SSL/TLS or not (the default is not to).  If
 'start-tls is specified then StartTLS is used rather than raw LDAP over SSL.")
   (tls-reqcert
-   (maybe-tls-reqcert-option 'disabled)
+   (maybe-tls-reqcert-option)
    "Specifies what checks to perform on a server-supplied certificate.
 The meaning of the values is described in the ldap.conf(5) manual page.")
   (tls-cacertdir
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the directory containing X.509 certificates for peer authen‐
 tication.  This parameter is ignored when using GnuTLS.")
   (tls-cacertfile
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the X.509 certificate for peer authentication.")
   (tls-randfile
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to an entropy source.  This parameter is ignored when
 using GnuTLS.")
   (tls-ciphers
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the ciphers to use for TLS as a string.")
   (tls-cert
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the file containing the local certificate for client
 TLS authentication.")
   (tls-key
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the file containing the private key for client TLS
 authentication.")
 
   ;; Other options
   (pagesize
-   (maybe-number 'disabled)
+   (maybe-number)
    "Set this to a number greater than 0 to request paged results from the LDAP
 server in accordance with RFC2696.  The default (0) is to not request paged
 results.")
   (nss-initgroups-ignoreusers
-   (maybe-ignore-users-option 'disabled)
+   (maybe-ignore-users-option)
    "This option prevents group membership lookups through LDAP for the
 specified users.  Alternatively, the value 'all-local may be used.  With that
 value nslcd builds a full list of non-LDAP users on startup.")
   (nss-min-uid
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option ensures that LDAP users with a numeric user id lower than the
 specified value are ignored.")
   (nss-uid-offset
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option specifies an offset that is added to all LDAP numeric user
 ids.  This can be used to avoid user id collisions with local users.")
   (nss-gid-offset
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option specifies an offset that is added to all LDAP numeric group
 ids.  This can be used to avoid user id collisions with local groups.")
   (nss-nested-groups
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, the member attribute of a group may point to
 another group.  Members of nested groups are also returned in the higher level
 group and parent groups are returned when finding groups for a specific user.
 The default is not to perform extra searches for nested groups.")
   (nss-getgrent-skipmembers
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, the group member list is not retrieved when looking
 up groups.  Lookups for finding which groups a user belongs to will remain
 functional so the user will likely still get the correct groups assigned on
 login.")
   (nss-disable-enumeration
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, functions which cause all user/group entries to be
 loaded from the directory will not succeed in doing so.  This can dramatically
 reduce LDAP server load in situations where there are a great number of users
 and/or groups.  This option is not recommended for most configurations.")
   (validnames
-   (maybe-string 'disabled)
+   (maybe-string)
    "This option can be used to specify how user and group names are verified
 within the system.  This pattern is used to check all user and group names
 that are requested and returned from LDAP.")
   (ignorecase
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "This specifies whether or not to perform searches using case-insensitive
 matching.  Enabling this could open up the system to authorization bypass
 vulnerabilities and introduce nscd cache poisoning vulnerabilities which allow
 denial of service.")
   (pam-authc-ppolicy
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "This option specifies whether password policy controls are requested and
 handled from the LDAP server when performing user authentication.")
   (pam-authc-search
-   (maybe-string 'disabled)
+   (maybe-string)
    "By default nslcd performs an LDAP search with the user's credentials after
 BIND (authentication) to ensure that the BIND operation was successful.  The
 default search is a simple check to see if the user's DN exists.  A search
 filter can be specified that will be used instead.  It should return at least
 one entry.")
   (pam-authz-search
-   (maybe-string 'disabled)
+   (maybe-string)
    "This option allows flexible fine tuning of the authorisation check that
 should be performed.  The search filter specified is executed and if any
 entries match, access is granted, otherwise access is denied.")
   (pam-password-prohibit-message
-   (maybe-string 'disabled)
+   (maybe-string)
    "If this option is set password modification using pam_ldap will be denied
 and the specified message will be presented to the user instead.  The message
 can be used to direct the user to an alternative means of changing their
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bfc89a40a4..bcb3e1a796 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -241,27 +241,27 @@ (define-configuration repository-cgit-configuration
    (repo-file-object "")
    "Override the default @code{email-filter}.")
   (enable-commit-graph?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.")
   (enable-log-filecount?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.")
   (enable-log-linecount?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.")
   (enable-remote-branches?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.")
   (enable-subject-links?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to override the global setting
 @code{enable-subject-links?}.")
   (enable-html-serving?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to override the global setting
 @code{enable-html-serving?}.")
   (hide?
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index bdca33ed68..f6b20fb82b 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -93,7 +93,7 @@ (define (configuration-field-error field val)
 (define (configuration-missing-field kind field)
   (configuration-error
    (format #f "~a configuration missing required field ~a" kind field)))
-(define (configuration-no-default-value kind field)
+(define (configuration-missing-default-value kind field)
   (configuration-error
    (format #f "The field `~a' of the `~a' configuration record \
 does not have a default value" field kind)))
@@ -142,7 +142,8 @@ (define (define-maybe-helper serialize? prefix syn)
                                     (id #'stem #'serialize-maybe- #'stem))))
        #`(begin
            (define (maybe-stem? val)
-             (or (eq? val 'disabled) (stem? val)))
+             (or (unspecified? val)
+                 (stem? val)))
            #,@(if serialize?
                   (list #'(define (serialize-maybe-stem field-name val)
                             (if (stem? val)
@@ -170,10 +171,10 @@ (define (normalize-field-type+def s)
      (values #'(field-type def)))
     ((field-type)
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))
+     (values #'(field-type *unspecified*)))
     (field-type
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))))
+     (values #'(field-type *unspecified*)))))
 
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
@@ -219,9 +220,7 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
                                           source-properties->location))
                           (innate))
                #,@(map (lambda (name getter def)
-                         (if (eq? (syntax->datum def) (quote 'undefined))
-                             #`(#,name #,getter)
-                             #`(#,name #,getter (default #,def))))
+                         #`(#,name #,getter (default #,def)))
                        #'(field ...)
                        #'(field-getter ...)
                        #'(field-default ...)))
@@ -236,8 +235,8 @@ (define #,(id #'stem #'stem #'-fields)
                         (lambda ()
                           (display '#,(id #'stem #'% #'stem))
                           (if (eq? (syntax->datum field-default)
-                                   'undefined)
-                              (configuration-no-default-value
+                                   '*unspecified*)
+                              (configuration-missing-default-value
                                '#,(id #'stem #'% #'stem) 'field)
                               field-default)))
                       (documentation doc))
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index e3d681b08f..6e71fa9154 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -115,8 +115,7 @@ (define-maybe string)
 (set! serialize-maybe-string
   (lambda (field-name val)
     (serialize-string field-name
-                      (if (and (symbol? val)
-                               (eq? val 'disabled))
+                      (if (unspecified? val)
                           ""
                           val))))
 
@@ -181,8 +180,7 @@ (define (serialize-file-object field-name val)
 (define-maybe file-object)
 (set! serialize-maybe-file-object
   (lambda (field-name val)
-    (if (and (symbol? val)
-             (eq? val 'disabled))
+    (if (unspecified? val)
         (serialize-string field-name "")
         (serialize-file-object field-name val))))
 
@@ -281,7 +279,7 @@ (define-configuration transmission-daemon-configuration
 torrent is complete.  Otherwise, files for all torrents (including those still
 being downloaded) will be placed in @code{download-dir}.")
   (incomplete-dir
-   (maybe-string 'disabled)
+   (maybe-string)
    "The directory in which files from incompletely downloaded torrents will be
 held when @code{incomplete-dir-enabled?} is @code{#t}.")
   (umask
@@ -305,7 +303,7 @@ (define-configuration transmission-daemon-configuration
 automatically (and the original files removed, if
 @code{trash-original-torrent-files?} is @code{#t}).")
   (watch-dir
-   (maybe-string 'disabled)
+   (maybe-string)
    "The directory to be watched for @file{.torrent} files indicating new
 torrents to be added, when @code{watch-dir-enabled} is @code{#t}.")
   (trash-original-torrent-files?
@@ -401,11 +399,11 @@ (define-configuration transmission-daemon-configuration
 @code{prefer-unencrypted-connections}, @code{prefer-encrypted-connections} or
 @code{require-encrypted-connections}.")
   (peer-congestion-algorithm
-   (maybe-string 'disabled)
+   (maybe-string)
    "The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt} (or leave it unset, in which case the operating-system
+default is used).
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -465,7 +463,7 @@ (define-configuration transmission-daemon-configuration
    "When @code{#t}, the daemon will ignore peers mentioned in the blocklist it
 has most recently downloaded from @code{blocklist-url}.")
   (blocklist-url
-   (maybe-string 'disabled)
+   (maybe-string)
    "The URL of a peer blocklist (in @acronym{P2P}-plaintext or eMule
 @file{.dat} format) to be periodically downloaded and applied when
 @code{blocklist-enabled?} is @code{#t}.")
@@ -564,11 +562,11 @@ (define-configuration transmission-daemon-configuration
 the side effect of disabling host-name whitelisting (see
 @code{rpc-host-whitelist-enabled?}.")
   (rpc-username
-   (maybe-string 'disabled)
+   (maybe-string)
    "The username required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.")
   (rpc-password
-   (maybe-transmission-password-hash 'disabled)
+   (maybe-transmission-password-hash)
    "The password required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.  This must be specified
 using a password hash in the format recognized by Transmission clients, either
@@ -613,7 +611,7 @@ (define-configuration transmission-daemon-configuration
 @code{script-torrent-done-filename} will be invoked each time a torrent
 completes.")
   (script-torrent-done-filename
-   (maybe-file-object 'disabled)
+   (maybe-file-object)
    "A file name or file-like object specifying a script to run each time a
 torrent completes, when @code{script-torrent-done-enabled?} is @code{#t}.")
   (scrape-paused-torrents-enabled?
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 4bceb1d37a..5f20d768ef 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -72,6 +72,7 @@ (define (make-pred arg)
       (lambda (field target)
         (and (memq (syntax->datum target) `(common ,arg)) field)))
     (syntax-case stx ()
+      ;; TODO Also handle (field-type) form, without a default.
       ((_ stem (field (field-type def) doc target) ...)
        (with-syntax (((new-field-type ...)
                       (map (lambda (field-type target)
@@ -85,7 +86,7 @@ (define (make-pred arg)
                      ((new-def ...)
                       (map (lambda (def target)
                              (if (eq? 'common (syntax->datum target))
-                                 #''disabled def))
+                                 #'*unspecified* def))
                            #'(def ...) #'(target ...)))
                      ((new-doc ...)
                       (map (lambda (doc target)
@@ -195,7 +196,7 @@ (define (serialize-file-object-list field-name val)
 (define-maybe file-object-list)
 
 (define (raw-content? val)
-  (not (eq? val 'disabled)))
+  (not (unspecified? val)))
 (define (serialize-raw-content field-name val)
   val)
 (define-maybe raw-content)
@@ -223,15 +224,15 @@ (define-maybe mod-muc-configuration)
 
 (define-configuration ssl-configuration
   (protocol
-   (maybe-string 'disabled)
+   (maybe-string)
    "This determines what handshake to use.")
 
   (key
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "Path to your private key file.")
 
   (certificate
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "Path to your certificate file.")
 
   (capath
@@ -240,48 +241,48 @@ (define-configuration ssl-configuration
 trust when verifying the certificates of remote servers.")
 
   (cafile
-   (maybe-file-object 'disabled)
+   (maybe-file-object)
    "Path to a file containing root certificates that you wish Prosody to trust.
 Similar to @code{capath} but with all certificates concatenated together.")
 
   (verify
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of verification options (these mostly map to OpenSSL's
 @code{set_verify()} flags).")
 
   (options
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of general options relating to SSL/TLS.  These map to OpenSSL's
 @code{set_options()}.  For a full list of options available in LuaSec, see the
 LuaSec source.")
 
   (depth
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "How long a chain of certificate authorities to check when looking for a
 trusted root certificate.")
 
   (ciphers
-   (maybe-string 'disabled)
+   (maybe-string)
    "An OpenSSL cipher string.  This selects what ciphers Prosody will offer to
 clients, and in what order.")
 
   (dhparam
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "A path to a file containing parameters for Diffie-Hellman key exchange.  You
 can create such a file with:
 @code{openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048}")
 
   (curve
-   (maybe-string 'disabled)
+   (maybe-string)
    "Curve for Elliptic curve Diffie-Hellman. Prosody's default is
 @samp{\"secp384r1\"}.")
 
   (verifyext
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of \"extra\" verification options.")
 
   (password
-   (maybe-string 'disabled)
+   (maybe-string)
    "Password for encrypted private keys."))
 (define (serialize-ssl-configuration field-name val)
   #~(format #f "ssl = {\n~a};\n"
@@ -469,12 +470,12 @@ (define-all-configurations prosody-configuration
      global)
 
     (http-max-content-size
-     (maybe-non-negative-integer 'disabled)
+     (maybe-non-negative-integer *unspecified*)
      "Maximum allowed size of the HTTP body (in bytes)."
      common)
 
     (http-external-url
-     (maybe-string 'disabled)
+     (maybe-string *unspecified*)
      "Some modules expose their own URL in various ways.  This URL is built
 from the protocol, host and port used.  If Prosody sits behind a proxy, the
 public URL will be @code{http-external-url} instead.  See
@@ -551,7 +552,7 @@ (define-all-configurations prosody-configuration
      int-component)
 
     (mod-muc
-     (maybe-mod-muc-configuration 'disabled)
+     (maybe-mod-muc-configuration *unspecified*)
      "Multi-user chat (MUC) is Prosody's module for allowing you to create
 hosted chatrooms/conferences for XMPP users.
 
@@ -568,7 +569,7 @@ (define-all-configurations prosody-configuration
      ext-component)
 
     (raw-content
-     (maybe-raw-content 'disabled)
+     (maybe-raw-content *unspecified*)
      "Raw content that will be added to the configuration file."
      common)))
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5bb8638930..b5c46218e7 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -763,17 +763,17 @@ (define-configuration/no-serialization opendht-configuration
    "The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the @code{:PORT}
 suffix.  By default, it uses the Jami bootstrap nodes, but any host can be
-specified here.  It's also possible to disable bootstrapping by setting this
-to the @code{'disabled} symbol.")
+specified here.  It's also possible to disable bootstrapping by explicitly
+setting this field to the @code{*unspecified*} value.")
   (port
    (maybe-number 4222)
-   "The UDP port to bind to.  When set to @code{'disabled}, an available port
-is automatically selected.")
+   "The UDP port to bind to.  When set to @code{*unspecified*}, an available
+port is automatically selected.")
   (proxy-server-port
-   (maybe-number 'disabled)
+   (maybe-number)
    "Spawn a proxy server listening on the specified port.")
   (proxy-server-port-tls
-   (maybe-number 'disabled)
+   (maybe-number)
    "Spawn a proxy server listening to TLS connections on the specified
 port."))
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index e48236dbca..d1250ab488 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -114,55 +114,55 @@ (define-configuration tlp-configuration
    "Same as @code{max-lost-work-secs-on-ac} but on BAT mode.")
 
   (cpu-scaling-governor-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "CPU frequency scaling governor on AC mode.  With intel_pstate
 driver, alternatives are powersave and performance.  With acpi-cpufreq driver,
 alternatives are ondemand, powersave, performance and conservative.")
 
   (cpu-scaling-governor-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Same as @code{cpu-scaling-governor-on-ac} but on BAT mode.")
 
   (cpu-scaling-min-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the min available frequency for the scaling governor on AC.")
 
   (cpu-scaling-max-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the max available frequency for the scaling governor on AC.")
 
   (cpu-scaling-min-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the min available frequency for the scaling governor on BAT.")
 
   (cpu-scaling-max-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the max available frequency for the scaling governor on BAT.")
 
   (cpu-min-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Limit the min P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-max-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Limit the max P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-min-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Same as @code{cpu-min-perf-on-ac} on BAT mode.")
 
   (cpu-max-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Same as @code{cpu-max-perf-on-ac} on BAT mode.")
 
   (cpu-boost-on-ac?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Enable CPU turbo boost feature on AC mode.")
 
   (cpu-boost-on-bat?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Same as @code{cpu-boost-on-ac?} on BAT mode.")
 
   (sched-powersave-on-ac?
@@ -179,7 +179,7 @@ (define-configuration tlp-configuration
    "Enable Linux kernel NMI watchdog.")
 
   (phc-controls
-   (maybe-string 'disabled)
+   (maybe-string)
    "For Linux kernels with PHC patch applied, change CPU voltages.
 An example value would be @samp{\"F:V F:V F:V F:V\"}.")
 
@@ -205,16 +205,16 @@ (define-configuration tlp-configuration
    "Same as @code{disk-apm-bat} but on BAT mode.")
 
   (disk-spindown-timeout-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Hard disk spin down timeout.  One value has to be specified for
 each declared hard disk.")
 
   (disk-spindown-timeout-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Same as @code{disk-spindown-timeout-on-ac} but on BAT mode.")
 
   (disk-iosched
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Select IO scheduler for disk devices.  One value has to be specified
 for each declared hard disk.  Example alternatives are cfq, deadline and noop.")
 
@@ -228,16 +228,16 @@ (define-configuration tlp-configuration
    "Same as @code{sata-linkpwr-ac} but on BAT mode.")
 
   (sata-linkpwr-blacklist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Exclude specified SATA host devices for link power management.")
 
   (ahci-runtime-pm-on-ac?
-   (maybe-on-off-boolean 'disabled)
+   (maybe-on-off-boolean)
    "Enable Runtime Power Management for AHCI controller and disks
 on AC mode.")
 
   (ahci-runtime-pm-on-bat?
-   (maybe-on-off-boolean 'disabled)
+   (maybe-on-off-boolean)
    "Same as @code{ahci-runtime-pm-on-ac} on BAT mode.")
 
   (ahci-runtime-pm-timeout
@@ -254,19 +254,19 @@ (define-configuration tlp-configuration
    "Same as @code{pcie-aspm-ac} but on BAT mode.")
 
   (start-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 0 should begin charging.")
 
   (stop-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 0 should stop charging.")
 
   (start-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 1 should begin charging.")
 
   (stop-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 1 should stop charging.")
 
   (radeon-power-profile-on-ac
@@ -346,7 +346,7 @@ (define-configuration tlp-configuration
 blacklisted ones.")
 
   (runtime-pm-blacklist
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Exclude specified PCI(e) device addresses from Runtime Power Management.")
 
   (runtime-pm-driver-blacklist
@@ -359,7 +359,7 @@ (define-configuration tlp-configuration
    "Enable USB autosuspend feature.")
 
   (usb-blacklist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Exclude specified devices from USB autosuspend.")
 
   (usb-blacklist-wwan?
@@ -367,12 +367,12 @@ (define-configuration tlp-configuration
    "Exclude WWAN devices from USB autosuspend.")
 
   (usb-whitelist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Include specified devices into USB autosuspend, even if they are
 already excluded by the driver or via @code{usb-blacklist-wwan?}.")
 
   (usb-autosuspend-disable-on-shutdown?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Enable USB autosuspend before shutdown.")
 
   (restore-device-state-on-startup?
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 157d96abd6..c153cb37c3 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -155,7 +155,7 @@ (define-configuration jami-account
 secret key material of the Jami account it contains."
    empty-serializer)
   (allowed-contacts
-   (maybe-account-fingerprint-list 'disabled)
+   (maybe-account-fingerprint-list)
    "The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in that list
 will be rejected.  When unspecified, the configuration of the account archive
@@ -164,7 +164,7 @@ (define-configuration jami-account
 the account."
    empty-serializer)
   (moderators
-   (maybe-account-fingerprint-list 'disabled)
+   (maybe-account-fingerprint-list)
    "The list of contacts that should have moderation privileges (to ban, mute,
 etc. other users) in rendezvous conferences, entered as their 40 characters
 long fingerprint.  When unspecified, the configuration of the account archive
@@ -173,24 +173,24 @@ (define-configuration jami-account
    empty-serializer)
   ;; The serializable fields below are to be set with set-account-details.
   (rendezvous-point?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Whether the account should operate in the rendezvous mode.  In this mode,
 all the incoming audio/video calls are mixed into a conference.  When left
 unspecified, the value from the account archive prevails.")
   (peer-discovery?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful to
 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 'disabled)
+   (maybe-string-list)
    "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.")
   (name-server-uri
-   (maybe-string 'disabled)
+   (maybe-string)
    "The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username."))
 
@@ -245,7 +245,7 @@ (define-configuration/no-serialization jami-configuration
    (boolean #f)
    "Whether to force automatic answer to incoming calls.")
   (accounts
-   (maybe-jami-account-list 'disabled)
+   (maybe-jami-account-list)
    "A list of Jami accounts to be (re-)provisioned every time the Jami daemon
 service starts.  When providing this field, the account directories under
 @file{/var/lib/jami/} are recreated every time the service starts, ensuring a
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index b24e9cffb3..133a5ad9bf 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -363,7 +363,7 @@ (define-split-configuration openvpn-client-configuration
 channel to protect against DoS attacks.")
 
    (auth-user-pass
-     (maybe-string 'disabled)
+    (maybe-string)
      "Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.")
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 0debf8095b..334a1e409b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -136,3 +136,15 @@ (define-configuration config-with-maybe-string/no-serialization
 
 (test-assert "maybe value without serialization no procedure bound"
   (not (defined? 'serialize-maybe-string)))
+
+(test-assert "maybe type, no default"
+  (unspecified?
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization))))
+
+(test-assert "maybe type, with default"
+  (equal?
+   "foo"
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization
+     (name "foo")))))
-- 
2.34.0





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 7 Apr 2022 15:12:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 07 11:12:07 2022
Received: from localhost ([127.0.0.1]:33134 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ncTnn-0007wO-IH
	for submit <at> debbugs.gnu.org; Thu, 07 Apr 2022 11:12:07 -0400
Received: from mail-ej1-f44.google.com ([209.85.218.44]:38726)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1ncTnj-0007vp-3T
 for 54674 <at> debbugs.gnu.org; Thu, 07 Apr 2022 11:12:03 -0400
Received: by mail-ej1-f44.google.com with SMTP id r13so11528902ejd.5
 for <54674 <at> debbugs.gnu.org>; Thu, 07 Apr 2022 08:11:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=YKMe6l2LFyryuc59w6VA3CAXuv0hy3RynD8elKpJdIs=;
 b=UsPhagrvZ1uhEzXkY3DNAZ3SfcGpZTeQmMXXoJzO2lNnjNGgT1vnyjouu8X2R2qdX7
 a0hUA6DtvmpDDh9VeNO+ikgMu9yR4UO/5YXf8v9bkv9cjfO1F3k1O+PlfoSQ67P3LsWS
 LfVK/jVjOeavzMC/ILGWuB3PQ/sj4e2qYteorkuqpOa7XiEaWzu3GxUgFIA0qwmIFmVY
 gJHos8vgQqcr/f5BmjQ+NLtqAOo9gyM3kxR1Kd16dczC10FFtYubOhjYUsx9MAnT7YEA
 vbc7fjx9UlWZdHKLkB+ehgkm2IcdoGIGzzGLX1eclEY9U+dH3jBkwj4v2CmKDedaNKSw
 xPjA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :mime-version:content-transfer-encoding;
 bh=YKMe6l2LFyryuc59w6VA3CAXuv0hy3RynD8elKpJdIs=;
 b=8Ogar/dRuckVcKgHemsZaMhGfoYar6Dz6DyCx6UmfdboHt0h487peIte+LTibhFVeT
 +GsAcjBpd/aE9iZkwIuUhl7FciV7nms2jkyc5xDxBxcgjlUAVP08hlYRMd+9S286/ahD
 8TRwMuPOP2CdCB2JsFwIYriji6pnyMD51z2AaDC+16+L5NcpaxJMPgh/ecx0I17nFdMs
 67MFB6Jw22fdeqzr1Rf9XR0trgobxeSfmtuGbU9KwIWHe5jyCmCQaGUNMdPQzIIN8E4/
 ShryYCwmLdEbYy5zgSINHHbYF1pAoPFHQUeWArioUS5TrqehUFC5IwAYJ6aeLP0+yTsC
 YXgg==
X-Gm-Message-State: AOAM530Ba82YrJNcgUnt5LGTHbMrbjGa22GYqyFRv9zuXZlV2+YsvYTs
 WSsPO9dEi4bSI6VomW/9Rho96OOXTiE=
X-Google-Smtp-Source: ABdhPJwioe6x0k9ZA4ehXNDxIX3jVHEoO/4NgevL/XXEUjAYBBxs45XmX8mhacuVGBKhGVVMm/nnPg==
X-Received: by 2002:a17:907:2d90:b0:6db:729e:7f25 with SMTP id
 gt16-20020a1709072d9000b006db729e7f25mr14080528ejc.203.1649344312854; 
 Thu, 07 Apr 2022 08:11:52 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 h24-20020a170906719800b006e82f0e4060sm956632ejk.205.2022.04.07.08.11.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 07 Apr 2022 08:11:52 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v3 1/2] services: configuration: Support (field1 maybe-number
 "") format.
Date: Thu,  7 Apr 2022 17:01:40 +0200
Message-Id: <20220407150140.32738-1-attila@HIDDEN>
X-Mailer: git-send-email 2.34.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.1 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  As opposed to explicitly using 'disabled as value, or using
 the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
 shared under #54674, with some modifications by Attila Lendvai. 
 Content analysis details:   (2.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (attila.lendvai[at]gmail.com)
 1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.218.44 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.218.44 listed in wl.mailspike.net]
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.1 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  As opposed to explicitly using 'disabled as value, or using
    the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
    shared under #54674, with some modifications by Attila Lendvai. 
 
 Content analysis details:   (1.1 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.218.44 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.218.44 listed in wl.mailspike.net]
  0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (attila.lendvai[at]gmail.com)
  1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

As opposed to explicitly using 'disabled as value, or using the
(field1 (maybe-number) "") format.

It's mostly the work of Maxime Devos shared under #54674, with some
modifications by Attila Lendvai.

* gnu/services/configuration.scm (normalize-field-type+def): New function.
(define-configuration-helper) (define-configuration): Support new field
format.
* tests/services/configuration.scm (config-with-maybe-number->string): New
function.
("maybe value serialization of the instance"): New test.
("maybe value serialization of the instance, unspecified"): New test.
---

v3: clean up the commit message. the code was not changed.

note that a large part of the diff is whitespace only.

 gnu/services/configuration.scm   | 169 +++++++++++++++++--------------
 tests/services/configuration.scm |  28 ++++-
 2 files changed, 114 insertions(+), 83 deletions(-)

diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 0de350a4df..bdca33ed68 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
+;;; Copyright © 2022 Maxime Devos <maximedevos@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -162,78 +163,90 @@ (define-maybe-helper #t #f #'(_ stem))))))
 (define-syntax-rule (define-maybe/no-serialization stem)
   (define-maybe stem (no-serialization)))
 
+(define (normalize-field-type+def s)
+  (syntax-case s ()
+    ((field-type def)
+     (identifier? #'field-type)
+     (values #'(field-type def)))
+    ((field-type)
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))
+    (field-type
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))))
+
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
-    ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
-     (with-syntax (((field-getter ...)
-                    (map (lambda (field)
-                           (id #'stem #'stem #'- field))
-    			 #'(field ...)))
-                   ((field-predicate ...)
-                    (map (lambda (type)
-                           (id #'stem type #'?))
-    			 #'(field-type ...)))
-                   ((field-default ...)
-                    (map (match-lambda
-    			   ((field-type default-value)
-                            default-value)
-    			   ((field-type)
-                            ;; Quote `undefined' to prevent a possibly
-                            ;; unbound warning.
-                            (syntax 'undefined)))
-    			 #'((field-type def ...) ...)))
-                   ((field-serializer ...)
-                    (map (lambda (type custom-serializer)
-                           (and serialize?
-                                (match custom-serializer
-                                  ((serializer)
-                                   serializer)
-                                  (()
-                                   (if serializer-prefix
-                                       (id #'stem
-                                           serializer-prefix
-                                           #'serialize- type)
-                                       (id #'stem #'serialize- type))))))
-                         #'(field-type ...)
-                         #'((custom-serializer ...) ...))))
-       #`(begin
-    	   (define-record-type* #,(id #'stem #'< #'stem #'>)
-    	     #,(id #'stem #'% #'stem)
-    	     #,(id #'stem #'make- #'stem)
-    	     #,(id #'stem #'stem #'?)
-    	     (%location #,(id #'stem #'stem #'-location)
-    			(default (and=> (current-source-location)
-    					source-properties->location))
-    			(innate))
-    	     #,@(map (lambda (name getter def)
-    		       (if (eq? (syntax->datum def) (quote 'undefined))
-    			   #`(#,name #,getter)
-    			   #`(#,name #,getter (default #,def))))
-    		     #'(field ...)
-    		     #'(field-getter ...)
-    		     #'(field-default ...)))
-    	   (define #,(id #'stem #'stem #'-fields)
-    	     (list (configuration-field
-    		    (name 'field)
-    		    (type 'field-type)
-    		    (getter field-getter)
-    		    (predicate field-predicate)
-    		    (serializer field-serializer)
-    		    (default-value-thunk
-    		      (lambda ()
-    			(display '#,(id #'stem #'% #'stem))
-    			(if (eq? (syntax->datum field-default)
-    				 'undefined)
-    			    (configuration-no-default-value
-    			     '#,(id #'stem #'% #'stem) 'field)
-    			    field-default)))
-    		    (documentation doc))
-    		   ...))
-    	   (define-syntax-rule (stem arg (... ...))
-    	     (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
-    	       (validate-configuration conf
-    				       #,(id #'stem #'stem #'-fields))
-    	       conf)))))))
+    ((_ stem (field field-type+def doc custom-serializer ...) ...)
+     (with-syntax
+         ((((field-type def) ...)
+           (map normalize-field-type+def #'(field-type+def ...))))
+       (with-syntax
+           (((field-getter ...)
+             (map (lambda (field)
+                    (id #'stem #'stem #'- field))
+                  #'(field ...)))
+            ((field-predicate ...)
+             (map (lambda (type)
+                    (id #'stem type #'?))
+                  #'(field-type ...)))
+            ((field-default ...)
+             (map (match-lambda
+                    ((field-type default-value)
+                     default-value))
+                  #'((field-type def) ...)))
+            ((field-serializer ...)
+             (map (lambda (type custom-serializer)
+                    (and serialize?
+                         (match custom-serializer
+                           ((serializer)
+                            serializer)
+                           (()
+                            (if serializer-prefix
+                                (id #'stem
+                                    serializer-prefix
+                                    #'serialize- type)
+                                (id #'stem #'serialize- type))))))
+                  #'(field-type ...)
+                  #'((custom-serializer ...) ...))))
+         #`(begin
+             (define-record-type* #,(id #'stem #'< #'stem #'>)
+               #,(id #'stem #'% #'stem)
+               #,(id #'stem #'make- #'stem)
+               #,(id #'stem #'stem #'?)
+               (%location #,(id #'stem #'stem #'-location)
+                          (default (and=> (current-source-location)
+                                          source-properties->location))
+                          (innate))
+               #,@(map (lambda (name getter def)
+                         (if (eq? (syntax->datum def) (quote 'undefined))
+                             #`(#,name #,getter)
+                             #`(#,name #,getter (default #,def))))
+                       #'(field ...)
+                       #'(field-getter ...)
+                       #'(field-default ...)))
+             (define #,(id #'stem #'stem #'-fields)
+               (list (configuration-field
+                      (name 'field)
+                      (type 'field-type)
+                      (getter field-getter)
+                      (predicate field-predicate)
+                      (serializer field-serializer)
+                      (default-value-thunk
+                        (lambda ()
+                          (display '#,(id #'stem #'% #'stem))
+                          (if (eq? (syntax->datum field-default)
+                                   'undefined)
+                              (configuration-no-default-value
+                               '#,(id #'stem #'% #'stem) 'field)
+                              field-default)))
+                      (documentation doc))
+                     ...))
+             (define-syntax-rule (stem arg (... ...))
+               (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
+                 (validate-configuration conf
+                                         #,(id #'stem #'stem #'-fields))
+                 conf))))))))
 
 (define no-serialization         ;syntactic keyword for 'define-configuration'
   '(no serialization))
@@ -241,26 +254,26 @@ (define no-serialization         ;syntactic keyword for 'define-configuration'
 (define-syntax define-configuration
   (lambda (s)
     (syntax-case s (no-serialization prefix)
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem (field field-type+def doc custom-serializer ...) ...
           (no-serialization))
        (define-configuration-helper
-         #f #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #f #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...)))
-      ((_ stem  (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem  (field field-type+def doc custom-serializer ...) ...
           (prefix serializer-prefix))
        (define-configuration-helper
-         #t #'serializer-prefix #'(_ stem (field (field-type def ...)
+         #t #'serializer-prefix #'(_ stem (field field-type+def
                                                  doc custom-serializer ...)
                  ...)))
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
+      ((_ stem (field field-type+def doc custom-serializer ...) ...)
        (define-configuration-helper
-         #t #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #t #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...))))))
 
 (define-syntax-rule (define-configuration/no-serialization
-                      stem (field (field-type def ...)
+                      stem (field field-type+def
                                   doc custom-serializer ...) ...)
-  (define-configuration stem (field (field-type def ...)
+  (define-configuration stem (field field-type+def
                                     doc custom-serializer ...) ...
     (no-serialization)))
 
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 86a36a388d..0debf8095b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -27,6 +27,9 @@ (define-module (tests services configuration)
 
 (test-begin "services-configuration")
 
+(define (serialize-number field value)
+  (format #f "~a=~a" field value))
+
 
 ;;;
 ;;; define-configuration macro.
@@ -47,7 +50,6 @@ (define-configuration port-configuration-cs
   80
   (port-configuration-cs-port (port-configuration-cs)))
 
-(define serialize-number "")
 (define-configuration port-configuration-ndv
   (port (number) "The port number."))
 
@@ -101,15 +103,31 @@ (define-configuration configuration-with-prefix
 (define-maybe number)
 
 (define-configuration config-with-maybe-number
-  (port (maybe-number 80) "The port number."))
-
-(define (serialize-number field value)
-  (format #f "~a=~a" field value))
+  (port  (maybe-number 80) "")
+  (count maybe-number ""))
 
 (test-equal "maybe value serialization"
   "port=80"
   (serialize-maybe-number "port" 80))
 
+(define (config-with-maybe-number->string x)
+  (eval (gexp->approximate-sexp
+         (serialize-configuration x config-with-maybe-number-fields))
+        (current-module)))
+
+(test-equal "maybe value serialization of the instance"
+  "port=42count=43"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42)
+    (count 43))))
+
+(test-equal "maybe value serialization of the instance, unspecified"
+  "port=42"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42))))
+
 (define-maybe/no-serialization string)
 
 (define-configuration config-with-maybe-string/no-serialization
-- 
2.34.0





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 7 Apr 2022 13:56:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 07 09:56:35 2022
Received: from localhost ([127.0.0.1]:33046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ncScj-00061z-Pn
	for submit <at> debbugs.gnu.org; Thu, 07 Apr 2022 09:56:35 -0400
Received: from mail-ej1-f43.google.com ([209.85.218.43]:34692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1ncScg-00061l-VJ
 for 54674 <at> debbugs.gnu.org; Thu, 07 Apr 2022 09:56:32 -0400
Received: by mail-ej1-f43.google.com with SMTP id l26so11066810ejx.1
 for <54674 <at> debbugs.gnu.org>; Thu, 07 Apr 2022 06:56:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=8yR8xW0aFmnU8eKER6Evq4FR6Ot4DU3Oa2CFKHCTKWo=;
 b=UWzs9eRzD4kkT4naf78Z6ZTmpanb1xpKmp6/muilgsJ5NwvR+sjNoFwPchqn0QJ1Yy
 6fs8lrFYjZAmjqUWd9398LSLUsKG3t+2473rAI19FGIRmuLkuvbPWp8VjFUXS+NkwtG9
 ntc8QfJEqptP6JByf0u+uTcWYaqC/bujrcWgCa3Rf74L+9ObHOdt+kyoUn2FxnSIOfY7
 ocqx7ym2bJ9eEgEquXN8VNMHpobV219lF5ouiFY/yQpmKTsEa5pao/hBPpb69Nx2zfni
 b6ouc/JL1mPrq9tdVawilMorGU7fprWPQVHJU0ZSeP4JdFQkrbnoKXym32IWMBGPmPzX
 ZLtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=8yR8xW0aFmnU8eKER6Evq4FR6Ot4DU3Oa2CFKHCTKWo=;
 b=opj2BQkeXQRIRFajGVmXhB4qdJkWC6q0wrmWtR0TzezXDGRvQK1Df0S5ah8HU/X6XZ
 kOcoVEnHsbqjlBwNBzUAOfckWye5oLgCpquLUZQhnuMOjgFK+eQSpALfgmIhA6RvKddK
 WHeeTJRcwAgzuegQyD1NHPk4j2sggZ/8hdcExtuuwQW6k4eyFcie8fzkFmpsX5jVzRou
 REM+/8n2Z/j0TKYqpVINLlEsptEtcWrlNXp5orLfL35AgBGg1heBHvQgZad9IwmKSikE
 Rp1CDoZOcCLl3nOiR7hgO4D5SNgNTwb83EdEnDtjmZTEpWJpkUzbk7eP2mMkn6z+LnHn
 GK9Q==
X-Gm-Message-State: AOAM531blQm7BPcwTRa55yjf9U9orJLdcuiXzL6YN2fpQ3Fjxg8G9m0I
 EQrCod5JxjkPnUUqAfUippJxs8m8Ags=
X-Google-Smtp-Source: ABdhPJx/iviAbiFE9hIZwDnPK9PpVxN3ZN3YTzwNa8/5i9vK2kb3+3Age5AiO/Yj9vfqcPFf/76Aww==
X-Received: by 2002:a17:906:1603:b0:6ce:362:c938 with SMTP id
 m3-20020a170906160300b006ce0362c938mr13658170ejd.253.1649339784368; 
 Thu, 07 Apr 2022 06:56:24 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 f1-20020a056402194100b00416b174987asm9387642edz.35.2022.04.07.06.56.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 07 Apr 2022 06:56:23 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v2 2/2] services: configuration: Use *unspecified* instead of
 'disabled.
Date: Thu,  7 Apr 2022 15:52:15 +0200
Message-Id: <20220407135213.17193-2-attila@HIDDEN>
X-Mailer: git-send-email 2.34.0
In-Reply-To: <20220407135213.17193-1-attila@HIDDEN>
References: <20220407135213.17193-1-attila@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

...as a marker for field values that have not been set. Rationale: 'disabled
may easily clash with user values for boolean fields, is confusing (i.e. its
meaning is *not* boolean false, bug unspecified) and it also passes through
silently the symbol? predicate of a field of type symbol.

Relax the syntax to accept (field1 (maybe-string) "") forms, in which case it
uses *unspecified* as default value.

Possible future improvement: also accept (field1 maybe-string "") forms,
i.e. without the extra parens around maybe types without defaults.

* gnu/services/configuration.scm (configuration-missing-default-value):
Renamed from configuration-no-default-value.
* gnu/services/configuration.scm (define-maybe-helper): Use *unspecified*
instead of 'disabled, and make the default value optional.
---

i haven't tested every service that got touched by this change. consider
it as a slightly tested proposal, that may very well end up being useful
as it is.

i have my service code on my server running on top of this, though. it
exercises serialization, and some nontrivial defaulting and
instantiations.

 gnu/home/services/desktop.scm    | 12 ++---
 gnu/services/authentication.scm  | 82 ++++++++++++++++----------------
 gnu/services/cgit.scm            | 12 ++---
 gnu/services/configuration.scm   | 17 ++++---
 gnu/services/file-sharing.scm    | 24 +++++-----
 gnu/services/messaging.scm       | 37 +++++++-------
 gnu/services/networking.scm      | 12 ++---
 gnu/services/pm.scm              | 54 ++++++++++-----------
 gnu/services/telephony.scm       | 14 +++---
 gnu/services/vpn.scm             |  2 +-
 tests/services/configuration.scm | 12 +++++
 11 files changed, 144 insertions(+), 134 deletions(-)

diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm
index cbb9cf76da..a54ad0d115 100644
--- a/gnu/home/services/desktop.scm
+++ b/gnu/home/services/desktop.scm
@@ -91,26 +91,26 @@ (define-configuration home-redshift-configuration
    "Nighttime color temperature (kelvins).")
 
   (daytime-brightness
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Daytime screen brightness, between 0.1 and 1.0.")
   (nighttime-brightness
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Nighttime screen brightness, between 0.1 and 1.0.")
 
   (latitude
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Latitude, when @code{location-provider} is @code{'manual}.")
   (longitude
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Longitude, when @code{location-provider} is @code{'manual}.")
 
   (dawn-time
-   (maybe-string 'disabled)
+   (maybe-string)
    "Custom time for the transition from night to day in the
 morning---@code{\"HH:MM\"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.")
   (dusk-time
-   (maybe-string 'disabled)
+   (maybe-string)
    "Likewise, custom time for the transition from day to night in the
 evening.")
 
diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm
index cb0ef6d85a..1c4800bfbd 100644
--- a/gnu/services/authentication.scm
+++ b/gnu/services/authentication.scm
@@ -218,7 +218,7 @@ (define-configuration nslcd-configuration
 
   ;; Runtime options
   (threads
-   (maybe-number 'disabled)
+   (maybe-number)
    "The number of threads to start that can handle requests and perform LDAP
 queries.  Each thread opens a separate connection to the LDAP server.  The
 default is to start 5 threads.")
@@ -243,45 +243,45 @@ (define-configuration nslcd-configuration
    "The list of LDAP server URIs.  Normally, only the first server will be
 used with the following servers as fall-back.")
   (ldap-version
-   (maybe-string 'disabled)
+   (maybe-string)
    "The version of the LDAP protocol to use.  The default is to use the
 maximum version supported by the LDAP library.")
   (binddn
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the distinguished name with which to bind to the directory
 server for lookups.  The default is to bind anonymously.")
   (bindpw
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the credentials with which to bind.  This option is only
 applicable when used with binddn.")
   (rootpwmoddn
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the distinguished name to use when the root user tries to modify
 a user's password using the PAM module.")
   (rootpwmodpw
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the credentials with which to bind if the root user tries to
 change a user's password.  This option is only applicable when used with
 rootpwmoddn")
 
   ;; SASL authentication options
   (sasl-mech
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the SASL mechanism to be used when performing SASL
 authentication.")
   (sasl-realm
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the SASL realm to be used when performing SASL authentication.")
   (sasl-authcid
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the authentication identity to be used when performing SASL
 authentication.")
   (sasl-authzid
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the authorization identity to be used when performing SASL
 authentication.")
   (sasl-canonicalize?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Determines whether the LDAP server host name should be canonicalised.  If
 this is enabled the LDAP library will do a reverse host name lookup.  By
 default, it is left up to the LDAP library whether this check is performed or
@@ -289,7 +289,7 @@ (define-configuration nslcd-configuration
 
   ;; Kerberos authentication options
   (krb5-ccname
-   (maybe-string 'disabled)
+   (maybe-string)
    "Set the name for the GSS-API Kerberos credentials cache.")
 
   ;; Search / mapping options
@@ -302,11 +302,11 @@ (define-configuration nslcd-configuration
 default scope is subtree; base scope is almost never useful for name service
 lookups; children scope is not supported on all servers.")
   (deref
-   (maybe-deref-option 'disabled)
+   (maybe-deref-option)
    "Specifies the policy for dereferencing aliases.  The default policy is to
 never dereference aliases.")
   (referrals
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Specifies whether automatic referral chasing should be enabled.  The
 default behaviour is to chase referrals.")
   (maps
@@ -322,132 +322,132 @@ (define-configuration nslcd-configuration
 
   ;; Timing / reconnect options
   (bind-timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time limit in seconds to use when connecting to the
 directory server.  The default value is 10 seconds.")
   (timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time limit (in seconds) to wait for a response from the LDAP
 server.  A value of zero, which is the default, is to wait indefinitely for
 searches to be completed.")
   (idle-timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the period if inactivity (in seconds) after which the con‐
 nection to the LDAP server will be closed.  The default is not to time out
 connections.")
   (reconnect-sleeptime
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the number of seconds to sleep when connecting to all LDAP
 servers fails.  By default one second is waited between the first failure and
 the first retry.")
   (reconnect-retrytime
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time after which the LDAP server is considered to be
 permanently unavailable.  Once this time is reached retries will be done only
 once per this time period.  The default value is 10 seconds.")
 
   ;; TLS options
   (ssl
-   (maybe-ssl-option 'disabled)
+   (maybe-ssl-option)
    "Specifies whether to use SSL/TLS or not (the default is not to).  If
 'start-tls is specified then StartTLS is used rather than raw LDAP over SSL.")
   (tls-reqcert
-   (maybe-tls-reqcert-option 'disabled)
+   (maybe-tls-reqcert-option)
    "Specifies what checks to perform on a server-supplied certificate.
 The meaning of the values is described in the ldap.conf(5) manual page.")
   (tls-cacertdir
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the directory containing X.509 certificates for peer authen‐
 tication.  This parameter is ignored when using GnuTLS.")
   (tls-cacertfile
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the X.509 certificate for peer authentication.")
   (tls-randfile
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to an entropy source.  This parameter is ignored when
 using GnuTLS.")
   (tls-ciphers
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the ciphers to use for TLS as a string.")
   (tls-cert
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the file containing the local certificate for client
 TLS authentication.")
   (tls-key
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the file containing the private key for client TLS
 authentication.")
 
   ;; Other options
   (pagesize
-   (maybe-number 'disabled)
+   (maybe-number)
    "Set this to a number greater than 0 to request paged results from the LDAP
 server in accordance with RFC2696.  The default (0) is to not request paged
 results.")
   (nss-initgroups-ignoreusers
-   (maybe-ignore-users-option 'disabled)
+   (maybe-ignore-users-option)
    "This option prevents group membership lookups through LDAP for the
 specified users.  Alternatively, the value 'all-local may be used.  With that
 value nslcd builds a full list of non-LDAP users on startup.")
   (nss-min-uid
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option ensures that LDAP users with a numeric user id lower than the
 specified value are ignored.")
   (nss-uid-offset
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option specifies an offset that is added to all LDAP numeric user
 ids.  This can be used to avoid user id collisions with local users.")
   (nss-gid-offset
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option specifies an offset that is added to all LDAP numeric group
 ids.  This can be used to avoid user id collisions with local groups.")
   (nss-nested-groups
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, the member attribute of a group may point to
 another group.  Members of nested groups are also returned in the higher level
 group and parent groups are returned when finding groups for a specific user.
 The default is not to perform extra searches for nested groups.")
   (nss-getgrent-skipmembers
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, the group member list is not retrieved when looking
 up groups.  Lookups for finding which groups a user belongs to will remain
 functional so the user will likely still get the correct groups assigned on
 login.")
   (nss-disable-enumeration
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, functions which cause all user/group entries to be
 loaded from the directory will not succeed in doing so.  This can dramatically
 reduce LDAP server load in situations where there are a great number of users
 and/or groups.  This option is not recommended for most configurations.")
   (validnames
-   (maybe-string 'disabled)
+   (maybe-string)
    "This option can be used to specify how user and group names are verified
 within the system.  This pattern is used to check all user and group names
 that are requested and returned from LDAP.")
   (ignorecase
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "This specifies whether or not to perform searches using case-insensitive
 matching.  Enabling this could open up the system to authorization bypass
 vulnerabilities and introduce nscd cache poisoning vulnerabilities which allow
 denial of service.")
   (pam-authc-ppolicy
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "This option specifies whether password policy controls are requested and
 handled from the LDAP server when performing user authentication.")
   (pam-authc-search
-   (maybe-string 'disabled)
+   (maybe-string)
    "By default nslcd performs an LDAP search with the user's credentials after
 BIND (authentication) to ensure that the BIND operation was successful.  The
 default search is a simple check to see if the user's DN exists.  A search
 filter can be specified that will be used instead.  It should return at least
 one entry.")
   (pam-authz-search
-   (maybe-string 'disabled)
+   (maybe-string)
    "This option allows flexible fine tuning of the authorisation check that
 should be performed.  The search filter specified is executed and if any
 entries match, access is granted, otherwise access is denied.")
   (pam-password-prohibit-message
-   (maybe-string 'disabled)
+   (maybe-string)
    "If this option is set password modification using pam_ldap will be denied
 and the specified message will be presented to the user instead.  The message
 can be used to direct the user to an alternative means of changing their
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bfc89a40a4..bcb3e1a796 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -241,27 +241,27 @@ (define-configuration repository-cgit-configuration
    (repo-file-object "")
    "Override the default @code{email-filter}.")
   (enable-commit-graph?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.")
   (enable-log-filecount?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.")
   (enable-log-linecount?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.")
   (enable-remote-branches?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.")
   (enable-subject-links?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to override the global setting
 @code{enable-subject-links?}.")
   (enable-html-serving?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to override the global setting
 @code{enable-html-serving?}.")
   (hide?
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index bdca33ed68..f6b20fb82b 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -93,7 +93,7 @@ (define (configuration-field-error field val)
 (define (configuration-missing-field kind field)
   (configuration-error
    (format #f "~a configuration missing required field ~a" kind field)))
-(define (configuration-no-default-value kind field)
+(define (configuration-missing-default-value kind field)
   (configuration-error
    (format #f "The field `~a' of the `~a' configuration record \
 does not have a default value" field kind)))
@@ -142,7 +142,8 @@ (define (define-maybe-helper serialize? prefix syn)
                                     (id #'stem #'serialize-maybe- #'stem))))
        #`(begin
            (define (maybe-stem? val)
-             (or (eq? val 'disabled) (stem? val)))
+             (or (unspecified? val)
+                 (stem? val)))
            #,@(if serialize?
                   (list #'(define (serialize-maybe-stem field-name val)
                             (if (stem? val)
@@ -170,10 +171,10 @@ (define (normalize-field-type+def s)
      (values #'(field-type def)))
     ((field-type)
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))
+     (values #'(field-type *unspecified*)))
     (field-type
      (identifier? #'field-type)
-     (values #'(field-type 'disabled)))))
+     (values #'(field-type *unspecified*)))))
 
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
@@ -219,9 +220,7 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
                                           source-properties->location))
                           (innate))
                #,@(map (lambda (name getter def)
-                         (if (eq? (syntax->datum def) (quote 'undefined))
-                             #`(#,name #,getter)
-                             #`(#,name #,getter (default #,def))))
+                         #`(#,name #,getter (default #,def)))
                        #'(field ...)
                        #'(field-getter ...)
                        #'(field-default ...)))
@@ -236,8 +235,8 @@ (define #,(id #'stem #'stem #'-fields)
                         (lambda ()
                           (display '#,(id #'stem #'% #'stem))
                           (if (eq? (syntax->datum field-default)
-                                   'undefined)
-                              (configuration-no-default-value
+                                   '*unspecified*)
+                              (configuration-missing-default-value
                                '#,(id #'stem #'% #'stem) 'field)
                               field-default)))
                       (documentation doc))
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index e3d681b08f..6e71fa9154 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -115,8 +115,7 @@ (define-maybe string)
 (set! serialize-maybe-string
   (lambda (field-name val)
     (serialize-string field-name
-                      (if (and (symbol? val)
-                               (eq? val 'disabled))
+                      (if (unspecified? val)
                           ""
                           val))))
 
@@ -181,8 +180,7 @@ (define (serialize-file-object field-name val)
 (define-maybe file-object)
 (set! serialize-maybe-file-object
   (lambda (field-name val)
-    (if (and (symbol? val)
-             (eq? val 'disabled))
+    (if (unspecified? val)
         (serialize-string field-name "")
         (serialize-file-object field-name val))))
 
@@ -281,7 +279,7 @@ (define-configuration transmission-daemon-configuration
 torrent is complete.  Otherwise, files for all torrents (including those still
 being downloaded) will be placed in @code{download-dir}.")
   (incomplete-dir
-   (maybe-string 'disabled)
+   (maybe-string)
    "The directory in which files from incompletely downloaded torrents will be
 held when @code{incomplete-dir-enabled?} is @code{#t}.")
   (umask
@@ -305,7 +303,7 @@ (define-configuration transmission-daemon-configuration
 automatically (and the original files removed, if
 @code{trash-original-torrent-files?} is @code{#t}).")
   (watch-dir
-   (maybe-string 'disabled)
+   (maybe-string)
    "The directory to be watched for @file{.torrent} files indicating new
 torrents to be added, when @code{watch-dir-enabled} is @code{#t}.")
   (trash-original-torrent-files?
@@ -401,11 +399,11 @@ (define-configuration transmission-daemon-configuration
 @code{prefer-unencrypted-connections}, @code{prefer-encrypted-connections} or
 @code{require-encrypted-connections}.")
   (peer-congestion-algorithm
-   (maybe-string 'disabled)
+   (maybe-string)
    "The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt} (or leave it unset, in which case the operating-system
+default is used).
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -465,7 +463,7 @@ (define-configuration transmission-daemon-configuration
    "When @code{#t}, the daemon will ignore peers mentioned in the blocklist it
 has most recently downloaded from @code{blocklist-url}.")
   (blocklist-url
-   (maybe-string 'disabled)
+   (maybe-string)
    "The URL of a peer blocklist (in @acronym{P2P}-plaintext or eMule
 @file{.dat} format) to be periodically downloaded and applied when
 @code{blocklist-enabled?} is @code{#t}.")
@@ -564,11 +562,11 @@ (define-configuration transmission-daemon-configuration
 the side effect of disabling host-name whitelisting (see
 @code{rpc-host-whitelist-enabled?}.")
   (rpc-username
-   (maybe-string 'disabled)
+   (maybe-string)
    "The username required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.")
   (rpc-password
-   (maybe-transmission-password-hash 'disabled)
+   (maybe-transmission-password-hash)
    "The password required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.  This must be specified
 using a password hash in the format recognized by Transmission clients, either
@@ -613,7 +611,7 @@ (define-configuration transmission-daemon-configuration
 @code{script-torrent-done-filename} will be invoked each time a torrent
 completes.")
   (script-torrent-done-filename
-   (maybe-file-object 'disabled)
+   (maybe-file-object)
    "A file name or file-like object specifying a script to run each time a
 torrent completes, when @code{script-torrent-done-enabled?} is @code{#t}.")
   (scrape-paused-torrents-enabled?
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 4bceb1d37a..5f20d768ef 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -72,6 +72,7 @@ (define (make-pred arg)
       (lambda (field target)
         (and (memq (syntax->datum target) `(common ,arg)) field)))
     (syntax-case stx ()
+      ;; TODO Also handle (field-type) form, without a default.
       ((_ stem (field (field-type def) doc target) ...)
        (with-syntax (((new-field-type ...)
                       (map (lambda (field-type target)
@@ -85,7 +86,7 @@ (define (make-pred arg)
                      ((new-def ...)
                       (map (lambda (def target)
                              (if (eq? 'common (syntax->datum target))
-                                 #''disabled def))
+                                 #'*unspecified* def))
                            #'(def ...) #'(target ...)))
                      ((new-doc ...)
                       (map (lambda (doc target)
@@ -195,7 +196,7 @@ (define (serialize-file-object-list field-name val)
 (define-maybe file-object-list)
 
 (define (raw-content? val)
-  (not (eq? val 'disabled)))
+  (not (unspecified? val)))
 (define (serialize-raw-content field-name val)
   val)
 (define-maybe raw-content)
@@ -223,15 +224,15 @@ (define-maybe mod-muc-configuration)
 
 (define-configuration ssl-configuration
   (protocol
-   (maybe-string 'disabled)
+   (maybe-string)
    "This determines what handshake to use.")
 
   (key
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "Path to your private key file.")
 
   (certificate
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "Path to your certificate file.")
 
   (capath
@@ -240,48 +241,48 @@ (define-configuration ssl-configuration
 trust when verifying the certificates of remote servers.")
 
   (cafile
-   (maybe-file-object 'disabled)
+   (maybe-file-object)
    "Path to a file containing root certificates that you wish Prosody to trust.
 Similar to @code{capath} but with all certificates concatenated together.")
 
   (verify
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of verification options (these mostly map to OpenSSL's
 @code{set_verify()} flags).")
 
   (options
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of general options relating to SSL/TLS.  These map to OpenSSL's
 @code{set_options()}.  For a full list of options available in LuaSec, see the
 LuaSec source.")
 
   (depth
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "How long a chain of certificate authorities to check when looking for a
 trusted root certificate.")
 
   (ciphers
-   (maybe-string 'disabled)
+   (maybe-string)
    "An OpenSSL cipher string.  This selects what ciphers Prosody will offer to
 clients, and in what order.")
 
   (dhparam
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "A path to a file containing parameters for Diffie-Hellman key exchange.  You
 can create such a file with:
 @code{openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048}")
 
   (curve
-   (maybe-string 'disabled)
+   (maybe-string)
    "Curve for Elliptic curve Diffie-Hellman. Prosody's default is
 @samp{\"secp384r1\"}.")
 
   (verifyext
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of \"extra\" verification options.")
 
   (password
-   (maybe-string 'disabled)
+   (maybe-string)
    "Password for encrypted private keys."))
 (define (serialize-ssl-configuration field-name val)
   #~(format #f "ssl = {\n~a};\n"
@@ -469,12 +470,12 @@ (define-all-configurations prosody-configuration
      global)
 
     (http-max-content-size
-     (maybe-non-negative-integer 'disabled)
+     (maybe-non-negative-integer *unspecified*)
      "Maximum allowed size of the HTTP body (in bytes)."
      common)
 
     (http-external-url
-     (maybe-string 'disabled)
+     (maybe-string *unspecified*)
      "Some modules expose their own URL in various ways.  This URL is built
 from the protocol, host and port used.  If Prosody sits behind a proxy, the
 public URL will be @code{http-external-url} instead.  See
@@ -551,7 +552,7 @@ (define-all-configurations prosody-configuration
      int-component)
 
     (mod-muc
-     (maybe-mod-muc-configuration 'disabled)
+     (maybe-mod-muc-configuration *unspecified*)
      "Multi-user chat (MUC) is Prosody's module for allowing you to create
 hosted chatrooms/conferences for XMPP users.
 
@@ -568,7 +569,7 @@ (define-all-configurations prosody-configuration
      ext-component)
 
     (raw-content
-     (maybe-raw-content 'disabled)
+     (maybe-raw-content *unspecified*)
      "Raw content that will be added to the configuration file."
      common)))
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5bb8638930..b5c46218e7 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -763,17 +763,17 @@ (define-configuration/no-serialization opendht-configuration
    "The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the @code{:PORT}
 suffix.  By default, it uses the Jami bootstrap nodes, but any host can be
-specified here.  It's also possible to disable bootstrapping by setting this
-to the @code{'disabled} symbol.")
+specified here.  It's also possible to disable bootstrapping by explicitly
+setting this field to the @code{*unspecified*} value.")
   (port
    (maybe-number 4222)
-   "The UDP port to bind to.  When set to @code{'disabled}, an available port
-is automatically selected.")
+   "The UDP port to bind to.  When set to @code{*unspecified*}, an available
+port is automatically selected.")
   (proxy-server-port
-   (maybe-number 'disabled)
+   (maybe-number)
    "Spawn a proxy server listening on the specified port.")
   (proxy-server-port-tls
-   (maybe-number 'disabled)
+   (maybe-number)
    "Spawn a proxy server listening to TLS connections on the specified
 port."))
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index e48236dbca..d1250ab488 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -114,55 +114,55 @@ (define-configuration tlp-configuration
    "Same as @code{max-lost-work-secs-on-ac} but on BAT mode.")
 
   (cpu-scaling-governor-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "CPU frequency scaling governor on AC mode.  With intel_pstate
 driver, alternatives are powersave and performance.  With acpi-cpufreq driver,
 alternatives are ondemand, powersave, performance and conservative.")
 
   (cpu-scaling-governor-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Same as @code{cpu-scaling-governor-on-ac} but on BAT mode.")
 
   (cpu-scaling-min-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the min available frequency for the scaling governor on AC.")
 
   (cpu-scaling-max-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the max available frequency for the scaling governor on AC.")
 
   (cpu-scaling-min-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the min available frequency for the scaling governor on BAT.")
 
   (cpu-scaling-max-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the max available frequency for the scaling governor on BAT.")
 
   (cpu-min-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Limit the min P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-max-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Limit the max P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-min-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Same as @code{cpu-min-perf-on-ac} on BAT mode.")
 
   (cpu-max-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Same as @code{cpu-max-perf-on-ac} on BAT mode.")
 
   (cpu-boost-on-ac?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Enable CPU turbo boost feature on AC mode.")
 
   (cpu-boost-on-bat?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Same as @code{cpu-boost-on-ac?} on BAT mode.")
 
   (sched-powersave-on-ac?
@@ -179,7 +179,7 @@ (define-configuration tlp-configuration
    "Enable Linux kernel NMI watchdog.")
 
   (phc-controls
-   (maybe-string 'disabled)
+   (maybe-string)
    "For Linux kernels with PHC patch applied, change CPU voltages.
 An example value would be @samp{\"F:V F:V F:V F:V\"}.")
 
@@ -205,16 +205,16 @@ (define-configuration tlp-configuration
    "Same as @code{disk-apm-bat} but on BAT mode.")
 
   (disk-spindown-timeout-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Hard disk spin down timeout.  One value has to be specified for
 each declared hard disk.")
 
   (disk-spindown-timeout-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Same as @code{disk-spindown-timeout-on-ac} but on BAT mode.")
 
   (disk-iosched
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Select IO scheduler for disk devices.  One value has to be specified
 for each declared hard disk.  Example alternatives are cfq, deadline and noop.")
 
@@ -228,16 +228,16 @@ (define-configuration tlp-configuration
    "Same as @code{sata-linkpwr-ac} but on BAT mode.")
 
   (sata-linkpwr-blacklist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Exclude specified SATA host devices for link power management.")
 
   (ahci-runtime-pm-on-ac?
-   (maybe-on-off-boolean 'disabled)
+   (maybe-on-off-boolean)
    "Enable Runtime Power Management for AHCI controller and disks
 on AC mode.")
 
   (ahci-runtime-pm-on-bat?
-   (maybe-on-off-boolean 'disabled)
+   (maybe-on-off-boolean)
    "Same as @code{ahci-runtime-pm-on-ac} on BAT mode.")
 
   (ahci-runtime-pm-timeout
@@ -254,19 +254,19 @@ (define-configuration tlp-configuration
    "Same as @code{pcie-aspm-ac} but on BAT mode.")
 
   (start-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 0 should begin charging.")
 
   (stop-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 0 should stop charging.")
 
   (start-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 1 should begin charging.")
 
   (stop-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 1 should stop charging.")
 
   (radeon-power-profile-on-ac
@@ -346,7 +346,7 @@ (define-configuration tlp-configuration
 blacklisted ones.")
 
   (runtime-pm-blacklist
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Exclude specified PCI(e) device addresses from Runtime Power Management.")
 
   (runtime-pm-driver-blacklist
@@ -359,7 +359,7 @@ (define-configuration tlp-configuration
    "Enable USB autosuspend feature.")
 
   (usb-blacklist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Exclude specified devices from USB autosuspend.")
 
   (usb-blacklist-wwan?
@@ -367,12 +367,12 @@ (define-configuration tlp-configuration
    "Exclude WWAN devices from USB autosuspend.")
 
   (usb-whitelist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Include specified devices into USB autosuspend, even if they are
 already excluded by the driver or via @code{usb-blacklist-wwan?}.")
 
   (usb-autosuspend-disable-on-shutdown?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Enable USB autosuspend before shutdown.")
 
   (restore-device-state-on-startup?
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 157d96abd6..c153cb37c3 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -155,7 +155,7 @@ (define-configuration jami-account
 secret key material of the Jami account it contains."
    empty-serializer)
   (allowed-contacts
-   (maybe-account-fingerprint-list 'disabled)
+   (maybe-account-fingerprint-list)
    "The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in that list
 will be rejected.  When unspecified, the configuration of the account archive
@@ -164,7 +164,7 @@ (define-configuration jami-account
 the account."
    empty-serializer)
   (moderators
-   (maybe-account-fingerprint-list 'disabled)
+   (maybe-account-fingerprint-list)
    "The list of contacts that should have moderation privileges (to ban, mute,
 etc. other users) in rendezvous conferences, entered as their 40 characters
 long fingerprint.  When unspecified, the configuration of the account archive
@@ -173,24 +173,24 @@ (define-configuration jami-account
    empty-serializer)
   ;; The serializable fields below are to be set with set-account-details.
   (rendezvous-point?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Whether the account should operate in the rendezvous mode.  In this mode,
 all the incoming audio/video calls are mixed into a conference.  When left
 unspecified, the value from the account archive prevails.")
   (peer-discovery?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful to
 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 'disabled)
+   (maybe-string-list)
    "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.")
   (name-server-uri
-   (maybe-string 'disabled)
+   (maybe-string)
    "The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username."))
 
@@ -245,7 +245,7 @@ (define-configuration/no-serialization jami-configuration
    (boolean #f)
    "Whether to force automatic answer to incoming calls.")
   (accounts
-   (maybe-jami-account-list 'disabled)
+   (maybe-jami-account-list)
    "A list of Jami accounts to be (re-)provisioned every time the Jami daemon
 service starts.  When providing this field, the account directories under
 @file{/var/lib/jami/} are recreated every time the service starts, ensuring a
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index b24e9cffb3..133a5ad9bf 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -363,7 +363,7 @@ (define-split-configuration openvpn-client-configuration
 channel to protect against DoS attacks.")
 
    (auth-user-pass
-     (maybe-string 'disabled)
+    (maybe-string)
      "Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.")
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 0debf8095b..334a1e409b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -136,3 +136,15 @@ (define-configuration config-with-maybe-string/no-serialization
 
 (test-assert "maybe value without serialization no procedure bound"
   (not (defined? 'serialize-maybe-string)))
+
+(test-assert "maybe type, no default"
+  (unspecified?
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization))))
+
+(test-assert "maybe type, with default"
+  (equal?
+   "foo"
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization
+     (name "foo")))))
-- 
2.34.0





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 7 Apr 2022 13:53:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 07 09:53:09 2022
Received: from localhost ([127.0.0.1]:60254 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ncSZQ-0005gs-Ut
	for submit <at> debbugs.gnu.org; Thu, 07 Apr 2022 09:53:09 -0400
Received: from mail-ej1-f53.google.com ([209.85.218.53]:37788)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1ncSZP-0005gb-Fa
 for 54674 <at> debbugs.gnu.org; Thu, 07 Apr 2022 09:53:08 -0400
Received: by mail-ej1-f53.google.com with SMTP id bg10so11031728ejb.4
 for <54674 <at> debbugs.gnu.org>; Thu, 07 Apr 2022 06:53:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=qK8JBptPO9o5gmgN6sjw8xcAIwidA+W4zSseYx+1TOg=;
 b=S320fhU6zaTj0Gjm16nuJgGxoSPNk3hzkxBBeg9wcgUtSEE/E03QlMsENUYrEJdELf
 8QdfwC/h+xzLmM0gG1sS7r3JtNvWdHChDVJ/iJs8Lx65as65QZ+Wl+UXFpBzyF9nkxhD
 NNsuXP5mLKyvm12SSQoaZPM9QI6E2DgTjMhWa+u6XvuSOk45QYEl7EeyNXJocbBApXPu
 KguC1Wzes5oJror+PJGRimmO/vlwm+ncpryaBuv63xyx0f2RcKLYrDVJRfqKko2IERNd
 LPc/FxaCPR+kl6fnRRF6G8CM4hCAaoTVOZiO4wGaoiDZbGc4IufysiADPn4VaAL3q/SG
 EfLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :mime-version:content-transfer-encoding;
 bh=qK8JBptPO9o5gmgN6sjw8xcAIwidA+W4zSseYx+1TOg=;
 b=gsM0zfW1TTm4VI4hp5fbwHaNxOExXMRQeXaa2QQNxxS19aqo+uahLMRxz+03b2/T4I
 tJSfrwEihpUxYWoKJxagvEX4GYrfQqG4QCFWWfFoX1YUhnZKYr1v5FLl741sVJmZyuOX
 NyjTRT0OPu3/PE9DnSPWGZt0BvWmI+QxmtNM4w1T99H17dlaE7JSlvMgJjByw/meIvZk
 x+Hpu56rJkCBzpeMW/tA8hNw8NRo2VW9EIEtGAsp0WweVySEfQiY3y27ZN19Qjhxbqce
 cuPBihooK98nhTkdfvfWWusWCeGlMY5bLdZOgwgrFy1psiBTnGUuR/2xMYyTJi2JzHL8
 C7iA==
X-Gm-Message-State: AOAM530mHS8tnirv9WeyJ/YXA5YGZEeeJzXzIcZa8hlHqqveZgLL1aaj
 O+nINQ4Ky/FYkS7PsOl9rOKXRkANGjs=
X-Google-Smtp-Source: ABdhPJxHHRdOwXTVLw6SRty2II5e3RJv/UYnwsppWM5GlZ1BRMzfyQNPc5MpgOZ1VuCYZK7DNWz5tQ==
X-Received: by 2002:a17:906:7711:b0:6db:32b4:f262 with SMTP id
 q17-20020a170906771100b006db32b4f262mr13941683ejm.522.1649339581291; 
 Thu, 07 Apr 2022 06:53:01 -0700 (PDT)
Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu.
 [89.132.245.188]) by smtp.gmail.com with ESMTPSA id
 f1-20020a056402194100b00416b174987asm9387642edz.35.2022.04.07.06.53.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 07 Apr 2022 06:53:00 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: 54674 <at> debbugs.gnu.org
Subject: [PATCH v2 1/2] services: configuration: Support (field1 maybe-number
 "") format.
Date: Thu,  7 Apr 2022 15:52:13 +0200
Message-Id: <20220407135213.17193-1-attila@HIDDEN>
X-Mailer: git-send-email 2.34.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 2.1 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  As opposed to explicitly using 'disabled as value, or using
 the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
 <maximedevos@HIDDEN>,
 with some modifications by me. * gnu/services/configuration.scm
 (normalize-field-type+def): New function. (define-configuration-helper)
 (define-configuration):
 Support new field format. * tests/services/configuration.scm (config-wi [...]
 Content analysis details:   (2.1 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.218.53 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (attila.lendvai[at]gmail.com)
 1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
 [URI: yoctocell.xyz (xyz)]
 0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [209.85.218.53 listed in wl.mailspike.net]
 0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 54674
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.1 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  As opposed to explicitly using 'disabled as value, or using
    the (field1 (maybe-number) "") format. It's mostly the work of Maxime Devos
    <maximedevos@HIDDEN>, with some modifications by me. * gnu/services/configuration.scm
    (normalize-field-type+def): New function. (define-configuration-helper) (define-configuration):
    Support new field format. * tests/services/configuration.scm (config-wi [...]
    
 
 Content analysis details:   (1.1 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.218.53 listed in list.dnswl.org]
  0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [209.85.218.53 listed in wl.mailspike.net]
  0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (attila.lendvai[at]gmail.com)
  1.6 PDS_OTHER_BAD_TLD      Untrustworthy TLDs
                             [URI: yoctocell.xyz (xyz)]
  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

As opposed to explicitly using 'disabled as value, or using the
(field1 (maybe-number) "") format.

It's mostly the work of Maxime Devos <maximedevos@HIDDEN>, with some
modifications by me.

* gnu/services/configuration.scm (normalize-field-type+def): New function.
(define-configuration-helper) (define-configuration): Support new field
format.
* tests/services/configuration.scm (config-with-maybe-number->string): New
function.
("maybe value serialization of the instance"): New test.
("maybe value serialization of the instance, unspecified"): New test.
---
 gnu/services/configuration.scm   | 169 +++++++++++++++++--------------
 tests/services/configuration.scm |  28 ++++-
 2 files changed, 114 insertions(+), 83 deletions(-)

diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 0de350a4df..bdca33ed68 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
+;;; Copyright © 2022 Maxime Devos <maximedevos@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -162,78 +163,90 @@ (define-maybe-helper #t #f #'(_ stem))))))
 (define-syntax-rule (define-maybe/no-serialization stem)
   (define-maybe stem (no-serialization)))
 
+(define (normalize-field-type+def s)
+  (syntax-case s ()
+    ((field-type def)
+     (identifier? #'field-type)
+     (values #'(field-type def)))
+    ((field-type)
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))
+    (field-type
+     (identifier? #'field-type)
+     (values #'(field-type 'disabled)))))
+
 (define (define-configuration-helper serialize? serializer-prefix syn)
   (syntax-case syn ()
-    ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
-     (with-syntax (((field-getter ...)
-                    (map (lambda (field)
-                           (id #'stem #'stem #'- field))
-    			 #'(field ...)))
-                   ((field-predicate ...)
-                    (map (lambda (type)
-                           (id #'stem type #'?))
-    			 #'(field-type ...)))
-                   ((field-default ...)
-                    (map (match-lambda
-    			   ((field-type default-value)
-                            default-value)
-    			   ((field-type)
-                            ;; Quote `undefined' to prevent a possibly
-                            ;; unbound warning.
-                            (syntax 'undefined)))
-    			 #'((field-type def ...) ...)))
-                   ((field-serializer ...)
-                    (map (lambda (type custom-serializer)
-                           (and serialize?
-                                (match custom-serializer
-                                  ((serializer)
-                                   serializer)
-                                  (()
-                                   (if serializer-prefix
-                                       (id #'stem
-                                           serializer-prefix
-                                           #'serialize- type)
-                                       (id #'stem #'serialize- type))))))
-                         #'(field-type ...)
-                         #'((custom-serializer ...) ...))))
-       #`(begin
-    	   (define-record-type* #,(id #'stem #'< #'stem #'>)
-    	     #,(id #'stem #'% #'stem)
-    	     #,(id #'stem #'make- #'stem)
-    	     #,(id #'stem #'stem #'?)
-    	     (%location #,(id #'stem #'stem #'-location)
-    			(default (and=> (current-source-location)
-    					source-properties->location))
-    			(innate))
-    	     #,@(map (lambda (name getter def)
-    		       (if (eq? (syntax->datum def) (quote 'undefined))
-    			   #`(#,name #,getter)
-    			   #`(#,name #,getter (default #,def))))
-    		     #'(field ...)
-    		     #'(field-getter ...)
-    		     #'(field-default ...)))
-    	   (define #,(id #'stem #'stem #'-fields)
-    	     (list (configuration-field
-    		    (name 'field)
-    		    (type 'field-type)
-    		    (getter field-getter)
-    		    (predicate field-predicate)
-    		    (serializer field-serializer)
-    		    (default-value-thunk
-    		      (lambda ()
-    			(display '#,(id #'stem #'% #'stem))
-    			(if (eq? (syntax->datum field-default)
-    				 'undefined)
-    			    (configuration-no-default-value
-    			     '#,(id #'stem #'% #'stem) 'field)
-    			    field-default)))
-    		    (documentation doc))
-    		   ...))
-    	   (define-syntax-rule (stem arg (... ...))
-    	     (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
-    	       (validate-configuration conf
-    				       #,(id #'stem #'stem #'-fields))
-    	       conf)))))))
+    ((_ stem (field field-type+def doc custom-serializer ...) ...)
+     (with-syntax
+         ((((field-type def) ...)
+           (map normalize-field-type+def #'(field-type+def ...))))
+       (with-syntax
+           (((field-getter ...)
+             (map (lambda (field)
+                    (id #'stem #'stem #'- field))
+                  #'(field ...)))
+            ((field-predicate ...)
+             (map (lambda (type)
+                    (id #'stem type #'?))
+                  #'(field-type ...)))
+            ((field-default ...)
+             (map (match-lambda
+                    ((field-type default-value)
+                     default-value))
+                  #'((field-type def) ...)))
+            ((field-serializer ...)
+             (map (lambda (type custom-serializer)
+                    (and serialize?
+                         (match custom-serializer
+                           ((serializer)
+                            serializer)
+                           (()
+                            (if serializer-prefix
+                                (id #'stem
+                                    serializer-prefix
+                                    #'serialize- type)
+                                (id #'stem #'serialize- type))))))
+                  #'(field-type ...)
+                  #'((custom-serializer ...) ...))))
+         #`(begin
+             (define-record-type* #,(id #'stem #'< #'stem #'>)
+               #,(id #'stem #'% #'stem)
+               #,(id #'stem #'make- #'stem)
+               #,(id #'stem #'stem #'?)
+               (%location #,(id #'stem #'stem #'-location)
+                          (default (and=> (current-source-location)
+                                          source-properties->location))
+                          (innate))
+               #,@(map (lambda (name getter def)
+                         (if (eq? (syntax->datum def) (quote 'undefined))
+                             #`(#,name #,getter)
+                             #`(#,name #,getter (default #,def))))
+                       #'(field ...)
+                       #'(field-getter ...)
+                       #'(field-default ...)))
+             (define #,(id #'stem #'stem #'-fields)
+               (list (configuration-field
+                      (name 'field)
+                      (type 'field-type)
+                      (getter field-getter)
+                      (predicate field-predicate)
+                      (serializer field-serializer)
+                      (default-value-thunk
+                        (lambda ()
+                          (display '#,(id #'stem #'% #'stem))
+                          (if (eq? (syntax->datum field-default)
+                                   'undefined)
+                              (configuration-no-default-value
+                               '#,(id #'stem #'% #'stem) 'field)
+                              field-default)))
+                      (documentation doc))
+                     ...))
+             (define-syntax-rule (stem arg (... ...))
+               (let ((conf (#,(id #'stem #'% #'stem) arg (... ...))))
+                 (validate-configuration conf
+                                         #,(id #'stem #'stem #'-fields))
+                 conf))))))))
 
 (define no-serialization         ;syntactic keyword for 'define-configuration'
   '(no serialization))
@@ -241,26 +254,26 @@ (define no-serialization         ;syntactic keyword for 'define-configuration'
 (define-syntax define-configuration
   (lambda (s)
     (syntax-case s (no-serialization prefix)
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem (field field-type+def doc custom-serializer ...) ...
           (no-serialization))
        (define-configuration-helper
-         #f #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #f #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...)))
-      ((_ stem  (field (field-type def ...) doc custom-serializer ...) ...
+      ((_ stem  (field field-type+def doc custom-serializer ...) ...
           (prefix serializer-prefix))
        (define-configuration-helper
-         #t #'serializer-prefix #'(_ stem (field (field-type def ...)
+         #t #'serializer-prefix #'(_ stem (field field-type+def
                                                  doc custom-serializer ...)
                  ...)))
-      ((_ stem (field (field-type def ...) doc custom-serializer ...) ...)
+      ((_ stem (field field-type+def doc custom-serializer ...) ...)
        (define-configuration-helper
-         #t #f #'(_ stem (field (field-type def ...) doc custom-serializer ...)
+         #t #f #'(_ stem (field field-type+def doc custom-serializer ...)
                  ...))))))
 
 (define-syntax-rule (define-configuration/no-serialization
-                      stem (field (field-type def ...)
+                      stem (field field-type+def
                                   doc custom-serializer ...) ...)
-  (define-configuration stem (field (field-type def ...)
+  (define-configuration stem (field field-type+def
                                     doc custom-serializer ...) ...
     (no-serialization)))
 
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 86a36a388d..0debf8095b 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -27,6 +27,9 @@ (define-module (tests services configuration)
 
 (test-begin "services-configuration")
 
+(define (serialize-number field value)
+  (format #f "~a=~a" field value))
+
 
 ;;;
 ;;; define-configuration macro.
@@ -47,7 +50,6 @@ (define-configuration port-configuration-cs
   80
   (port-configuration-cs-port (port-configuration-cs)))
 
-(define serialize-number "")
 (define-configuration port-configuration-ndv
   (port (number) "The port number."))
 
@@ -101,15 +103,31 @@ (define-configuration configuration-with-prefix
 (define-maybe number)
 
 (define-configuration config-with-maybe-number
-  (port (maybe-number 80) "The port number."))
-
-(define (serialize-number field value)
-  (format #f "~a=~a" field value))
+  (port  (maybe-number 80) "")
+  (count maybe-number ""))
 
 (test-equal "maybe value serialization"
   "port=80"
   (serialize-maybe-number "port" 80))
 
+(define (config-with-maybe-number->string x)
+  (eval (gexp->approximate-sexp
+         (serialize-configuration x config-with-maybe-number-fields))
+        (current-module)))
+
+(test-equal "maybe value serialization of the instance"
+  "port=42count=43"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42)
+    (count 43))))
+
+(test-equal "maybe value serialization of the instance, unspecified"
+  "port=42"
+  (config-with-maybe-number->string
+   (config-with-maybe-number
+    (port 42))))
+
 (define-maybe/no-serialization string)
 
 (define-configuration config-with-maybe-string/no-serialization
-- 
2.34.0





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 4 Apr 2022 11:25:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 04 07:25:20 2022
Received: from localhost ([127.0.0.1]:50644 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nbKpk-0005L1-6F
	for submit <at> debbugs.gnu.org; Mon, 04 Apr 2022 07:25:20 -0400
Received: from andre.telenet-ops.be ([195.130.132.53]:37910)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1nbKpi-0005Ks-7D
 for 54674 <at> debbugs.gnu.org; Mon, 04 Apr 2022 07:25:19 -0400
Received: from [172.20.10.5] ([188.188.236.140])
 by andre.telenet-ops.be with bizsmtp
 id EbRF2700C32RwxY01bRF5g; Mon, 04 Apr 2022 13:25:16 +0200
Message-ID: <bcaab1bbb79a6cd3d4503f5f57f4ef7eb20cb52f.camel@HIDDEN>
Subject: Re: [bug#54674] [PATCH] services: configuration: Use *unspecified*
 instead of 'disabled.
From: Maxime Devos <maximedevos@HIDDEN>
To: Attila Lendvai <attila@HIDDEN>
Date: Mon, 04 Apr 2022 13:25:11 +0200
In-Reply-To: <RyjP_EnJExOZtmPhVCyaItCm7UL0vmEX6dksmALrBGXALN_VruCqiFyWM0MqmBflw_zwb1ZJ97WO4SjbAY_Hn97vgotOpY3bwntDDxkAov0=@lendvai.name>
References: <20220401191957.16624-1-attila@HIDDEN>
 <2f39bf8cd56b3019026e43532b2f7b937de99b7e.camel@HIDDEN>
 <RyjP_EnJExOZtmPhVCyaItCm7UL0vmEX6dksmALrBGXALN_VruCqiFyWM0MqmBflw_zwb1ZJ97WO4SjbAY_Hn97vgotOpY3bwntDDxkAov0=@lendvai.name>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-L+irPwfcrfWSMdxK2I1C"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1649071516; bh=32bzLeOiOKTTSD9Wy/wtxIGO7L+4liqAIrvEYr5CgeQ=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=Iwx89byT+dniiQzhG4lO6hqrarnvl0eKACiMLxTZFFP7zAUneXTkYKvZS58Un+56X
 DZ3Ci6ZD4dpukTEbyUosxf7thXi3OSHPWzwb3pnfGatL79BanpMoQxkTxHS4jAV1YN
 0tUCXTmZe9uKXm4U/+gObhUpH/IEP2KsWX9ngFQxjkaklMiz+cC9mWPhfoPyfRiAqY
 edXykuZCXaeoFFiGHSJiREYFd16HgBXZWHK3SVVW0+yPbWlUisunvV8RMMqdQZ+E2U
 oBuiPjKvyI8u5Mu3Cn7fT7KcxViiuvP2X9q+Jp0NrKyyqSMhz7wowxsPY3g/K3tQto
 S084dJqP8XbNA==
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: 54674
Cc: 54674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)


--=-L+irPwfcrfWSMdxK2I1C
Content-Type: multipart/mixed; boundary="=-2R83KWjveLaJsB7Hrkld"


--=-2R83KWjveLaJsB7Hrkld
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Attila Lendvai schreef op ma 04-04-2022 om 07:46 [+0000]:
> in this change i try to introduce a codepath for a canonical form for
> DEFINE-CONFIGURATION fields, but it won't work this way, because this
> way the SYNTAX-CASE forms will only match when *every* field is of
> the specified shape.

See attachement for poposed solution. (Not done: *unspecified* instead
of the symbol 'disabled' as default).

Greetings,
Maxime.

--=-2R83KWjveLaJsB7Hrkld
Content-Description: 
Content-Disposition: inline; filename="aaa.diff"
Content-Transfer-Encoding: base64
Content-Type: text/x-patch; name="aaa.diff"; charset="UTF-8"

ZGlmZiAtLWdpdCBhL2dudS9zZXJ2aWNlcy9jb25maWd1cmF0aW9uLnNjbSBiL2dudS9zZXJ2aWNl
cy9jb25maWd1cmF0aW9uLnNjbQppbmRleCAwZGUzNTBhNGRmLi4wNmJiNzNjOWZhIDEwMDY0NAot
LS0gYS9nbnUvc2VydmljZXMvY29uZmlndXJhdGlvbi5zY20KKysrIGIvZ251L3NlcnZpY2VzL2Nv
bmZpZ3VyYXRpb24uc2NtCkBAIC01LDYgKzUsNyBAQAogOzs7IENvcHlyaWdodCDCqSAyMDIxIFhp
bmdsdSBDaGVuIDxwdWJsaWNAeW9jdG9jZWxsLnh5ej4KIDs7OyBDb3B5cmlnaHQgwqkgMjAyMSBN
YXhpbSBDb3Vybm95ZXIgPG1heGltLmNvdXJub3llckBnbWFpbC5jb20+CiA7OzsgQ29weXJpZ2h0
IMKpIDIwMjEgQW5kcmV3IFRyb3BpbiA8YW5kcmV3QHRyb3AuaW4+Cis7OzsgQ29weXJpZ2h0IMKp
IDIwMjIgTWF4aW1lIERldm9zIDxtYXhpbWVkZXZvc0B0ZWxlbmV0LmJlPgogOzs7CiA7OzsgVGhp
cyBmaWxlIGlzIHBhcnQgb2YgR05VIEd1aXguCiA7OzsKQEAgLTE2Miw5ICsxNjMsMjEgQEAgZG9l
cyBub3QgaGF2ZSBhIGRlZmF1bHQgdmFsdWUiIGZpZWxkIGtpbmQpKSkKIChkZWZpbmUtc3ludGF4
LXJ1bGUgKGRlZmluZS1tYXliZS9uby1zZXJpYWxpemF0aW9uIHN0ZW0pCiAgIChkZWZpbmUtbWF5
YmUgc3RlbSAobm8tc2VyaWFsaXphdGlvbikpKQogCisoZGVmaW5lIChhbmFseXNlLWZpZWxkLXR5
cGUrZGVmIHMpCisgIChzeW50YXgtY2FzZSBzICgpCisgICAgKChmaWVsZC10eXBlIGRlZiAuLi4p
CisgICAgIChpZGVudGlmaWVyPyAjJ2ZpZWxkLXR5cGUpCisgICAgICh2YWx1ZXMgIycoZmllbGQt
dHlwZSBkZWYgLi4uKSkpCisgICAgKGZpZWxkLXR5cGUKKyAgICAgKGlkZW50aWZpZXI/ICMnZmll
bGQtdHlwZSkKKyAgICAgKHZhbHVlcyAjJyhmaWVsZC10eXBlKSkpKSkKKwogKGRlZmluZSAoZGVm
aW5lLWNvbmZpZ3VyYXRpb24taGVscGVyIHNlcmlhbGl6ZT8gc2VyaWFsaXplci1wcmVmaXggc3lu
KQogICAoc3ludGF4LWNhc2Ugc3luICgpCi0gICAgKChfIHN0ZW0gKGZpZWxkIChmaWVsZC10eXBl
IGRlZiAuLi4pIGRvYyBjdXN0b20tc2VyaWFsaXplciAuLi4pIC4uLikKKyAgICAoKF8gc3RlbSAo
ZmllbGQgZmllbGQtdHlwZStkZWYgZG9jIGN1c3RvbS1zZXJpYWxpemVyIC4uLikgLi4uKQorICAg
ICA7OyBUT0RPOiBmaXggaW5kZW50YXRpb24sIG1heWJlIHdpdGgtc3ludGF4Kj8KKyAgICAgKHdp
dGgtc3ludGF4ICgoKChmaWVsZC10eXBlIGRlZiAuLi4pIC4uLikKKyAgICAgICAgICAgICAgICAg
ICAgKG1hcCBhbmFseXNlLWZpZWxkLXR5cGUrZGVmICMnKGZpZWxkLXR5cGUrZGVmIC4uLikpKSkK
ICAgICAgKHdpdGgtc3ludGF4ICgoKGZpZWxkLWdldHRlciAuLi4pCiAgICAgICAgICAgICAgICAg
ICAgIChtYXAgKGxhbWJkYSAoZmllbGQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaWQg
IydzdGVtICMnc3RlbSAjJy0gZmllbGQpKQpAQCAtMjMzLDcgKzI0Niw3IEBAIGRvZXMgbm90IGhh
dmUgYSBkZWZhdWx0IHZhbHVlIiBmaWVsZCBraW5kKSkpCiAgICAgCSAgICAgKGxldCAoKGNvbmYg
KCMsKGlkICMnc3RlbSAjJyUgIydzdGVtKSBhcmcgKC4uLiAuLi4pKSkpCiAgICAgCSAgICAgICAo
dmFsaWRhdGUtY29uZmlndXJhdGlvbiBjb25mCiAgICAgCQkJCSAgICAgICAjLChpZCAjJ3N0ZW0g
IydzdGVtICMnLWZpZWxkcykpCi0gICAgCSAgICAgICBjb25mKSkpKSkpKQorICAgICAgICAgICAg
ICBjb25mKSkpKSkpKSkKIAogKGRlZmluZSBuby1zZXJpYWxpemF0aW9uICAgICAgICAgO3N5bnRh
Y3RpYyBrZXl3b3JkIGZvciAnZGVmaW5lLWNvbmZpZ3VyYXRpb24nCiAgICcobm8gc2VyaWFsaXph
dGlvbikpCkBAIC0yNDEsMjYgKzI1NCwyNiBAQCBkb2VzIG5vdCBoYXZlIGEgZGVmYXVsdCB2YWx1
ZSIgZmllbGQga2luZCkpKQogKGRlZmluZS1zeW50YXggZGVmaW5lLWNvbmZpZ3VyYXRpb24KICAg
KGxhbWJkYSAocykKICAgICAoc3ludGF4LWNhc2UgcyAobm8tc2VyaWFsaXphdGlvbiBwcmVmaXgp
Ci0gICAgICAoKF8gc3RlbSAoZmllbGQgKGZpZWxkLXR5cGUgZGVmIC4uLikgZG9jIGN1c3RvbS1z
ZXJpYWxpemVyIC4uLikgLi4uCisgICAgICAoKF8gc3RlbSAoZmllbGQgZmllbGQtdHlwZStkZWYg
ZG9jIGN1c3RvbS1zZXJpYWxpemVyIC4uLikgLi4uCiAgICAgICAgICAgKG5vLXNlcmlhbGl6YXRp
b24pKQogICAgICAgIChkZWZpbmUtY29uZmlndXJhdGlvbi1oZWxwZXIKLSAgICAgICAgICNmICNm
ICMnKF8gc3RlbSAoZmllbGQgKGZpZWxkLXR5cGUgZGVmIC4uLikgZG9jIGN1c3RvbS1zZXJpYWxp
emVyIC4uLikKKyAgICAgICAgICNmICNmICMnKF8gc3RlbSAoZmllbGQgZmllbGQtdHlwZStkZWYg
ZG9jIGN1c3RvbS1zZXJpYWxpemVyIC4uLikKICAgICAgICAgICAgICAgICAgLi4uKSkpCi0gICAg
ICAoKF8gc3RlbSAgKGZpZWxkIChmaWVsZC10eXBlIGRlZiAuLi4pIGRvYyBjdXN0b20tc2VyaWFs
aXplciAuLi4pIC4uLgorICAgICAgKChfIHN0ZW0gIChmaWVsZCBmaWVsZC10eXBlK2RlZiBkb2Mg
Y3VzdG9tLXNlcmlhbGl6ZXIgLi4uKSAuLi4KICAgICAgICAgICAocHJlZml4IHNlcmlhbGl6ZXIt
cHJlZml4KSkKICAgICAgICAoZGVmaW5lLWNvbmZpZ3VyYXRpb24taGVscGVyCi0gICAgICAgICAj
dCAjJ3NlcmlhbGl6ZXItcHJlZml4ICMnKF8gc3RlbSAoZmllbGQgKGZpZWxkLXR5cGUgZGVmIC4u
LikKKyAgICAgICAgICN0ICMnc2VyaWFsaXplci1wcmVmaXggIycoXyBzdGVtIChmaWVsZCBmaWVs
ZC10eXBlK2RlZgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGRvYyBjdXN0b20tc2VyaWFsaXplciAuLi4pCiAgICAgICAgICAgICAgICAgIC4uLikpKQot
ICAgICAgKChfIHN0ZW0gKGZpZWxkIChmaWVsZC10eXBlIGRlZiAuLi4pIGRvYyBjdXN0b20tc2Vy
aWFsaXplciAuLi4pIC4uLikKKyAgICAgICgoXyBzdGVtIChmaWVsZCBmaWVsZC10eXBlK2RlZiBk
b2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKSAuLi4pCiAgICAgICAgKGRlZmluZS1jb25maWd1cmF0
aW9uLWhlbHBlcgotICAgICAgICAgI3QgI2YgIycoXyBzdGVtIChmaWVsZCAoZmllbGQtdHlwZSBk
ZWYgLi4uKSBkb2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKQorICAgICAgICAgI3QgI2YgIycoXyBz
dGVtIChmaWVsZCBmaWVsZC10eXBlK2RlZiBkb2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKQogICAg
ICAgICAgICAgICAgICAuLi4pKSkpKSkKIAogKGRlZmluZS1zeW50YXgtcnVsZSAoZGVmaW5lLWNv
bmZpZ3VyYXRpb24vbm8tc2VyaWFsaXphdGlvbgotICAgICAgICAgICAgICAgICAgICAgIHN0ZW0g
KGZpZWxkIChmaWVsZC10eXBlIGRlZiAuLi4pCisgICAgICAgICAgICAgICAgICAgICAgc3RlbSAo
ZmllbGQgZmllbGQtdHlwZStkZWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBk
b2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKSAuLi4pCi0gIChkZWZpbmUtY29uZmlndXJhdGlvbiBz
dGVtIChmaWVsZCAoZmllbGQtdHlwZSBkZWYgLi4uKQorICAoZGVmaW5lLWNvbmZpZ3VyYXRpb24g
c3RlbSAoZmllbGQgZmllbGQtdHlwZStkZWYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIGRvYyBjdXN0b20tc2VyaWFsaXplciAuLi4pIC4uLgogICAgIChuby1zZXJpYWxpemF0
aW9uKSkpCiAK


--=-2R83KWjveLaJsB7Hrkld--

--=-L+irPwfcrfWSMdxK2I1C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkrVlxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7taNAP0UtsD5oguueo+SRMddpyGU4qm/
Z2b6ndulZ73sbgQp0QD+MSUW2i0wzuxe11cxgt+UZCns7yyJiVymo63YOXP/Agg=
=eSmH
-----END PGP SIGNATURE-----

--=-L+irPwfcrfWSMdxK2I1C--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 4 Apr 2022 07:46:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 04 03:46:31 2022
Received: from localhost ([127.0.0.1]:50393 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nbHPz-0005sn-1B
	for submit <at> debbugs.gnu.org; Mon, 04 Apr 2022 03:46:31 -0400
Received: from mail-40136.proton.ch ([185.70.40.136]:39590)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila@HIDDEN>) id 1nbHPv-0005sV-H9
 for 54674 <at> debbugs.gnu.org; Mon, 04 Apr 2022 03:46:29 -0400
Date: Mon, 04 Apr 2022 07:46:15 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name;
 s=protonmail3; t=1649058380;
 bh=Jnspcnu+ijoLrm7+aaq0l9GoAdpOCnA4lkwn+HfDreQ=;
 h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To:
 References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID;
 b=BubNVr7VmxnVW7ecTau8j5+Wo1XX+IiKAqzizthiTvU/hbSG2SI2GoBFOhOw073PR
 JLXz47RPHQs+oo+0gjqDfjLW9rVijwqD3qFT+Sq8sii0njt2rH3dLjoWNHI133l8MS
 /3ycLrYxZMwRy9TsikB6oHTHL6vmBIrojD6e6ZdqsHBJUzOdkq8vSa0vaSbmaUUJFV
 0kGyzwcYR5e7GhjaZdqhiNY8K9inU4AvErcbWT6irWyf/2YDGv2pWOgF0YWj1vGzTD
 7fJvv9KaPuT+xAZ0ufGHmVmehEaYgkDAEDFQAU5X6e9LP0YjhpCJLvRCncLi8YsRc/
 BiqmsG0mmcpfA==
To: Maxime Devos <maximedevos@HIDDEN>
From: Attila Lendvai <attila@HIDDEN>
Subject: Re: [bug#54674] [PATCH] services: configuration: Use *unspecified*
 instead of 'disabled.
Message-ID: <RyjP_EnJExOZtmPhVCyaItCm7UL0vmEX6dksmALrBGXALN_VruCqiFyWM0MqmBflw_zwb1ZJ97WO4SjbAY_Hn97vgotOpY3bwntDDxkAov0=@lendvai.name>
In-Reply-To: <2f39bf8cd56b3019026e43532b2f7b937de99b7e.camel@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
 <2f39bf8cd56b3019026e43532b2f7b937de99b7e.camel@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="b1_pbVo2HvaO0JEQbPUpBvAesq7NzFQnORahgb9K1SMcI"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 54674
Cc: 54674 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Attila Lendvai <attila@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This is a multi-part message in MIME format.

--b1_pbVo2HvaO0JEQbPUpBvAesq7NzFQnORahgb9K1SMcI
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

> > the reason i didn't do the (field1 maybe-string "") syntax *i.e. no
> > parens around maybe-string), is that i couldn't convince the hygienic
> > macro system about it.
>
> Do you have some non-working code? Maybe I can make it work ...

thank you for your kind offer Maxime! i have attached a half-baked patch.

it should also resolve your other nice catch of my mistaken use of UNSPECIF=
IED? on syntax objects.

in this change i try to introduce a codepath for a canonical form for DEFIN=
E-CONFIGURATION fields, but it won't work this way, because this way the SY=
NTAX-CASE forms will only match when *every* field is of the specified shap=
e.

the solution is probably in the direction of introducing a new DEFINE-CONFI=
GURATION-HELPER/FIELD somehow, but hygienic macros are a rather new territo=
ry for me...

as for the (threads (number 5)) change: i'd rather not do it in this commit=
 to try to keep it as much idempotent wrt behavior as possible.

--
=E2=80=A2 attila lendvai
=E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39
--
=E2=80=9CThe important thing is to not stop questioning. Curiosity has its =
own reason for existing.=E2=80=9D
=09=E2=80=94 Albert Einstein (1879=E2=80=931955)

--b1_pbVo2HvaO0JEQbPUpBvAesq7NzFQnORahgb9K1SMcI
Content-Type: text/x-patch; name=0001-WIP-define-configuration-accepts-field1-maybe-string-forms.patch
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=0001-WIP-define-configuration-accepts-field1-maybe-string-forms.patch

ZGlmZiAtLWdpdCBhL2dudS9zZXJ2aWNlcy9jb25maWd1cmF0aW9uLnNjbSBiL2dudS9zZXJ2aWNl
cy9jb25maWd1cmF0aW9uLnNjbQppbmRleCAzMjVlZjZlMGFjLi4yOGRjMzE0MzAxIDEwMDY0NAot
LS0gYS9nbnUvc2VydmljZXMvY29uZmlndXJhdGlvbi5zY20KKysrIGIvZ251L3NlcnZpY2VzL2Nv
bmZpZ3VyYXRpb24uc2NtCkBAIC0xNjUsNyArMTY1LDcgQEAgKGRlZmluZS1tYXliZSBzdGVtIChu
by1zZXJpYWxpemF0aW9uKSkpCiAKIChkZWZpbmUgKGRlZmluZS1jb25maWd1cmF0aW9uLWhlbHBl
ciBzZXJpYWxpemU/IHNlcmlhbGl6ZXItcHJlZml4IHN5bikKICAgKHN5bnRheC1jYXNlIHN5biAo
KQotICAgICgoXyBzdGVtIChmaWVsZCAoZmllbGQtdHlwZSBkZWYgLi4uKSBkb2MgY3VzdG9tLXNl
cmlhbGl6ZXIgLi4uKSAuLi4pCisgICAgKChfIHN0ZW0gKGZpZWxkIChmaWVsZC10eXBlIGRlZikg
ZG9jIGN1c3RvbS1zZXJpYWxpemVyIC4uLikgLi4uKQogICAgICAod2l0aC1zeW50YXggKCgoZmll
bGQtZ2V0dGVyIC4uLikKICAgICAgICAgICAgICAgICAgICAgKG1hcCAobGFtYmRhIChmaWVsZCkK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpZCAjJ3N0ZW0gIydzdGVtICMnLSBmaWVsZCkp
CkBAIC0yMDUsOSArMjA1LDcgQEAgKGRlZmluZS1yZWNvcmQtdHlwZSogIywoaWQgIydzdGVtICMn
PCAjJ3N0ZW0gIyc+KQogICAgIAkJCQkJc291cmNlLXByb3BlcnRpZXMtPmxvY2F0aW9uKSkKICAg
ICAJCQkoaW5uYXRlKSkKICAgICAJICAgICAjLEAobWFwIChsYW1iZGEgKG5hbWUgZ2V0dGVyIGRl
ZikKLSAgICAJCSAgICAgICAoaWYgKHVuc3BlY2lmaWVkPyAoc3ludGF4LT5kYXR1bSBkZWYpKQot
ICAgIAkJCSAgICNgKCMsbmFtZSAjLGdldHRlcikKLSAgICAJCQkgICAjYCgjLG5hbWUgIyxnZXR0
ZXIgKGRlZmF1bHQgIyxkZWYpKSkpCisgICAgCQkgICAgICAgI2AoIyxuYW1lICMsZ2V0dGVyIChk
ZWZhdWx0ICMsZGVmKSkpCiAgICAgCQkgICAgICMnKGZpZWxkIC4uLikKICAgICAJCSAgICAgIyco
ZmllbGQtZ2V0dGVyIC4uLikKICAgICAJCSAgICAgIycoZmllbGQtZGVmYXVsdCAuLi4pKSkKQEAg
LTIzMSw3ICsyMjksMTMgQEAgKGRlZmluZS1zeW50YXgtcnVsZSAoc3RlbSBhcmcgKC4uLiAuLi4p
KQogICAgIAkgICAgIChsZXQgKChjb25mICgjLChpZCAjJ3N0ZW0gIyclICMnc3RlbSkgYXJnICgu
Li4gLi4uKSkpKQogICAgIAkgICAgICAgKHZhbGlkYXRlLWNvbmZpZ3VyYXRpb24gY29uZgogICAg
IAkJCQkgICAgICAgIywoaWQgIydzdGVtICMnc3RlbSAjJy1maWVsZHMpKQotICAgIAkgICAgICAg
Y29uZikpKSkpKSkKKyAgICAJICAgICAgIGNvbmYpKSkpKQorICAgIDs7IFRPRE8gVGhpcyBkb2Vz
IG5vdCB3b3JrLCBiZWNhdXNlIGl0IG1hdGNoZXMgd2hlbiAqZXZlcnkqIGZpZWxkIGlzIG9mCisg
ICAgOzsgdGhpcyBmb3JtLgorICAgICgoXyBzdGVtIChmaWVsZCAoZmllbGQtdHlwZSkgZG9jIGN1
c3RvbS1zZXJpYWxpemVyIC4uLikgLi4uKQorICAgICAoc3RlbSAoZmllbGQgKGZpZWxkLXR5cGUg
KnVuc3BlY2lmaWVkKikgZG9jIGN1c3RvbS1zZXJpYWxpemVyIC4uLikgLi4uKSkKKyAgICAoKF8g
c3RlbSAoZmllbGQgZmllbGQtdHlwZSBkb2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKSAuLi4pCisg
ICAgIChzdGVtIChmaWVsZCAoZmllbGQtdHlwZSAqdW5zcGVjaWZpZWQqKSBkb2MgY3VzdG9tLXNl
cmlhbGl6ZXIgLi4uKSAuLi4pKSkpCiAKIChkZWZpbmUgbm8tc2VyaWFsaXphdGlvbiAgICAgICAg
IDtzeW50YWN0aWMga2V5d29yZCBmb3IgJ2RlZmluZS1jb25maWd1cmF0aW9uJwogICAnKG5vIHNl
cmlhbGl6YXRpb24pKQpAQCAtMjM5LDI3ICsyNDMsMTkgQEAgKGRlZmluZSBuby1zZXJpYWxpemF0
aW9uICAgICAgICAgO3N5bnRhY3RpYyBrZXl3b3JkIGZvciAnZGVmaW5lLWNvbmZpZ3VyYXRpb24n
CiAoZGVmaW5lLXN5bnRheCBkZWZpbmUtY29uZmlndXJhdGlvbgogICAobGFtYmRhIChzKQogICAg
IChzeW50YXgtY2FzZSBzIChuby1zZXJpYWxpemF0aW9uIHByZWZpeCkKLSAgICAgICgoXyBzdGVt
IChmaWVsZCAoZmllbGQtdHlwZSBkZWYgLi4uKSBkb2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKSAu
Li4KLSAgICAgICAgICAobm8tc2VyaWFsaXphdGlvbikpCi0gICAgICAgKGRlZmluZS1jb25maWd1
cmF0aW9uLWhlbHBlcgotICAgICAgICAgI2YgI2YgIycoXyBzdGVtIChmaWVsZCAoZmllbGQtdHlw
ZSBkZWYgLi4uKSBkb2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKQotICAgICAgICAgICAgICAgICAu
Li4pKSkKLSAgICAgICgoXyBzdGVtICAoZmllbGQgKGZpZWxkLXR5cGUgZGVmIC4uLikgZG9jIGN1
c3RvbS1zZXJpYWxpemVyIC4uLikgLi4uCi0gICAgICAgICAgKHByZWZpeCBzZXJpYWxpemVyLXBy
ZWZpeCkpCi0gICAgICAgKGRlZmluZS1jb25maWd1cmF0aW9uLWhlbHBlcgotICAgICAgICAgI3Qg
IydzZXJpYWxpemVyLXByZWZpeCAjJyhfIHN0ZW0gKGZpZWxkIChmaWVsZC10eXBlIGRlZiAuLi4p
Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jIGN1
c3RvbS1zZXJpYWxpemVyIC4uLikKLSAgICAgICAgICAgICAgICAgLi4uKSkpCi0gICAgICAoKF8g
c3RlbSAoZmllbGQgKGZpZWxkLXR5cGUgZGVmIC4uLikgZG9jIGN1c3RvbS1zZXJpYWxpemVyIC4u
LikgLi4uKQotICAgICAgIChkZWZpbmUtY29uZmlndXJhdGlvbi1oZWxwZXIKLSAgICAgICAgICN0
ICNmICMnKF8gc3RlbSAoZmllbGQgKGZpZWxkLXR5cGUgZGVmIC4uLikgZG9jIGN1c3RvbS1zZXJp
YWxpemVyIC4uLikKLSAgICAgICAgICAgICAgICAgLi4uKSkpKSkpCisgICAgICAoKF8gc3RlbSBm
aWVsZHMgLi4uIChuby1zZXJpYWxpemF0aW9uKSkKKyAgICAgICAoZGVmaW5lLWNvbmZpZ3VyYXRp
b24taGVscGVyICNmICNmCisgICAgICAgICAjJyhfIHN0ZW0gZmllbGRzIC4uLikpKQorICAgICAg
KChfIHN0ZW0gZmllbGRzIC4uLiAocHJlZml4IHNlcmlhbGl6ZXItcHJlZml4KSkKKyAgICAgICAo
ZGVmaW5lLWNvbmZpZ3VyYXRpb24taGVscGVyICN0ICMnc2VyaWFsaXplci1wcmVmaXgKKyAgICAg
ICAgICMnKF8gc3RlbSBmaWVsZHMgLi4uKSkpCisgICAgICAoKF8gc3RlbSBmaWVsZHMgLi4uKQor
ICAgICAgIChkZWZpbmUtY29uZmlndXJhdGlvbi1oZWxwZXIgI3QgI2YKKyAgICAgICAgICMnKF8g
c3RlbSBmaWVsZHMgLi4uKSkpKSkpCiAKIChkZWZpbmUtc3ludGF4LXJ1bGUgKGRlZmluZS1jb25m
aWd1cmF0aW9uL25vLXNlcmlhbGl6YXRpb24KLSAgICAgICAgICAgICAgICAgICAgICBzdGVtIChm
aWVsZCAoZmllbGQtdHlwZSBkZWYgLi4uKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGRvYyBjdXN0b20tc2VyaWFsaXplciAuLi4pIC4uLikKLSAgKGRlZmluZS1jb25maWd1cmF0
aW9uIHN0ZW0gKGZpZWxkIChmaWVsZC10eXBlIGRlZiAuLi4pCi0gICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICBkb2MgY3VzdG9tLXNlcmlhbGl6ZXIgLi4uKSAuLi4KKyAgICAgICAg
ICAgICAgICAgICAgICBzdGVtIChmaWVsZCB0eXBlLWFuZC1kZWYgZG9jIGN1c3RvbS1zZXJpYWxp
emVyIC4uLikgLi4uKQorICAoZGVmaW5lLWNvbmZpZ3VyYXRpb24gc3RlbSAoZmllbGQgdHlwZS1h
bmQtZGVmIGRvYyBjdXN0b20tc2VyaWFsaXplciAuLi4pIC4uLgogICAgIChuby1zZXJpYWxpemF0
aW9uKSkpCiAKIChkZWZpbmUgKGVtcHR5LXNlcmlhbGl6ZXIgZmllbGQtbmFtZSB2YWwpICIiKQo=

--b1_pbVo2HvaO0JEQbPUpBvAesq7NzFQnORahgb9K1SMcI--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 1 Apr 2022 19:58:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 01 15:58:41 2022
Received: from localhost ([127.0.0.1]:43529 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1naNPt-0006Xm-57
	for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:58:41 -0400
Received: from baptiste.telenet-ops.be ([195.130.132.51]:36318)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1naNPr-0006XZ-O9
 for 54674 <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:58:40 -0400
Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a])
 by baptiste.telenet-ops.be with bizsmtp
 id DXye2700N4UW6Th01XyeVH; Fri, 01 Apr 2022 21:58:39 +0200
Message-ID: <2f39bf8cd56b3019026e43532b2f7b937de99b7e.camel@HIDDEN>
Subject: Re: [bug#54674] [PATCH] services: configuration: Use *unspecified*
 instead of 'disabled.
From: Maxime Devos <maximedevos@HIDDEN>
To: Attila Lendvai <attila@HIDDEN>, 54674 <at> debbugs.gnu.org
Date: Fri, 01 Apr 2022 21:58:38 +0200
In-Reply-To: <20220401191957.16624-1-attila@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-s67fw47MTCWtj/I2yQHZ"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1648843119; bh=ti22XXD8fYtXqqh1votuMSsjkcGJ0o+8fnLHhsrlxP0=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=OLh71HgmxslYL8gNBvthMYnrRYTLoRm1StHgzeY7egDXiwOrk1eE+pSLCJyMiz2QE
 q18qY9DF7iyr+lBFsTAUtJd2Vq8LIr4gCR/boba9AmdzOR5DPCcrS4HnBMUWkqTSl/
 hqagUPPZCRr+xKpZ2jvnApMdavMiSPaLsF4FnEsEXXKhFoSgDnx/U5nTxAAT6MCt1V
 HnAavbajh4A0vOCxVqaVbEYKXuz7AYE7wLz7po+s0fKmV3kAS+6T78aR2m1D1hzcej
 tOjS4y85nSQhu/0c1d/s/1kOW/uzjd9YX4dIky1zCbp+9MnCWY44mjyJMM3o3oYUwt
 tuGcZ5qhbLpnQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 54674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-s67fw47MTCWtj/I2yQHZ
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Attila Lendvai schreef op vr 01-04-2022 om 21:19 [+0200]:
> the reason i didn't do the (field1 maybe-string "") syntax *i.e. no
> parens around maybe-string), is that i couldn't convince the hygienic
> macro system about it.

Do you have some non-working code?  Maybe I can make it work ...

Greetings,
Maxime.

--=-s67fw47MTCWtj/I2yQHZ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkdZbhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qQZAP9aNuXzu2epA5qurspUl3EZMilp
aCqXbGReM9qNIqR+LQEAlzCsmYkFuCHQENgX/yw3+GSAyuCszvPLuZs1g9fLgQE=
=TZnz
-----END PGP SIGNATURE-----

--=-s67fw47MTCWtj/I2yQHZ--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 1 Apr 2022 19:57:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 01 15:57:08 2022
Received: from localhost ([127.0.0.1]:43523 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1naNON-0006VO-Qi
	for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:57:08 -0400
Received: from baptiste.telenet-ops.be ([195.130.132.51]:34768)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1naNOL-0006VF-MW
 for 54674 <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:57:06 -0400
Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a])
 by baptiste.telenet-ops.be with bizsmtp
 id DXx32700V4UW6Th01Xx3Kb; Fri, 01 Apr 2022 21:57:04 +0200
Message-ID: <0be3a60eb95672b6dc5101b966c85f2f3c810224.camel@HIDDEN>
Subject: Re: [bug#54674] [PATCH] services: configuration: Use *unspecified*
 instead of 'disabled.
From: Maxime Devos <maximedevos@HIDDEN>
To: Attila Lendvai <attila@HIDDEN>, 54674 <at> debbugs.gnu.org
Date: Fri, 01 Apr 2022 21:56:58 +0200
In-Reply-To: <20220401191957.16624-1-attila@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-BWn6DKzDWpRHa8Ln8BGf"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1648843024; bh=8iTj+KfmY/SPaSqwbnKpH4TGBf3ffooOyVLG+ktjSIc=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=NJbETQL3TNcpZiCg1aJks0gWTA8bBgwpkcik+VMyEJPxHt3lDLJcufB2xb7S7V0Za
 tOxWiujGA+MID6TgcNmcG/C00lYCwV7jjRG42kWdk3A1DpjRFp6Xih0QJAlnmWQKw7
 HhVTm9y0lb2VqTqhKhBVBd0t5EW/sJlvHZqN/2Ris707CaFSmchLzdFjigDJQM0umC
 80yr7iDqizvyRv7IIzZUSSsyOWdE3U5hfKOOil0m4Ce5rTwwEK0jvwrT1UKYBzODGs
 16f953Xt1iilGEbyqsRbSSzHoW9K60XoOGeWMEDHKtP3BBGvimxdDB/aKYFjKV+cVP
 kHrIAOTP0WRIg==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 54674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-BWn6DKzDWpRHa8Ln8BGf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Attila Lendvai schreef op vr 01-04-2022 om 21:19 [+0200]:
+=C2=A0=C2=A0=C2=A0=C2=A0		=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (unspec=
ified? (syntax->datum def))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0			=C2=A0=C2=A0 #`(#,name #,getter)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0			=C2=A0=C2=A0 #`(#,name #,getter (default #=
,def))))

I'm not sure this does what you want it to do:

(define-syntax foo
  (lambda (s)
    (syntax-case s ()
      ((_ bar)
       (pk (syntax->datum #'bar) (unspecified? (syntax->datum #'bar)))))))
(foo *unspecified*)
;;; (*unspecified* #f)

The problem is that, from the macro systems POV, *unspecified* is just
a variable reference to the global *unspecified* --- *unspecified*
isn't magic to the reader, the reader just interprets it as a symbol.

Suggestion:

(define-syntax foo2
  (lambda (s)
    (syntax-case s ()
      ((_ bar)
       (pk (syntax->datum #'bar)
           (and (identifier? #'bar)
                (free-identifier=3D? #'*unspecified* #'bar)))))))
(foo2 *unspecified*)
;;; (*unspecified* #t)

Greetings,
Maxime.

--=-BWn6DKzDWpRHa8Ln8BGf
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkdZChccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jpoAQCp1WOmWX1IIoj6rGCArnUDXe3Z
1OiZRD5BL4ZPBJluSwEAo907Qp37c+mZn6Rs7BzHLkhNu3UjJYC+VfFAyBz2nQg=
=Kajf
-----END PGP SIGNATURE-----

--=-BWn6DKzDWpRHa8Ln8BGf--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at 54674 <at> debbugs.gnu.org:


Received: (at 54674) by debbugs.gnu.org; 1 Apr 2022 19:46:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 01 15:46:41 2022
Received: from localhost ([127.0.0.1]:43504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1naNEG-0006Cp-Vn
	for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:46:41 -0400
Received: from andre.telenet-ops.be ([195.130.132.53]:58732)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1naNEF-0006Ch-La
 for 54674 <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:46:40 -0400
Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a])
 by andre.telenet-ops.be with bizsmtp
 id DXme270014UW6Th01Xme5a; Fri, 01 Apr 2022 21:46:38 +0200
Message-ID: <e6f7ab11fb77a06c9b5139cd8068734af4d48fab.camel@HIDDEN>
Subject: Re: [bug#54674] [PATCH] services: configuration: Use *unspecified*
 instead of 'disabled.
From: Maxime Devos <maximedevos@HIDDEN>
To: Attila Lendvai <attila@HIDDEN>, 54674 <at> debbugs.gnu.org
Date: Fri, 01 Apr 2022 21:46:37 +0200
In-Reply-To: <20220401191957.16624-1-attila@HIDDEN>
References: <20220401191957.16624-1-attila@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-ejd8r1ac0OalP6BK5cbw"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1648842398; bh=qLQNIzK1vWplf/yqYFMaAQgE71tS6pogrG4F2RYH4l4=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=fjOclAo+gOazCXJbORVdtW9W/8/0CKJsKcW2z/udB45eTf0zTeF8voMVVoBDFdSqc
 A79QFKoF91i4C5+oIs14dLrOwQVvDaKn41pxhTwR5qQ1N5AEGkF6ZxRVD0+e5pAZ0m
 8se5G/JKm01biLWzTHqSgjlpXr03e2RTcQP9KhaBUn19erIpxZ/p1FBCbQEhoIm7vX
 sXcB0PzrelYYA9GZrgySk4dHWaBvsISe5tpU3BhpteMiTET7IX7OLxX/DcsPNWrf+9
 YJ2sSXZTqxp/JkvwcNR4wg/3y70i8fj5LwQ6osciv/YphQk92bExro6qlGkSqZrCv/
 yKV4J1JR1akHQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 54674
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-ejd8r1ac0OalP6BK5cbw
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Attila Lendvai schreef op vr 01-04-2022 om 21:19 [+0200]:
> ...as a marker for field values that have not been set. Rationale: 'disab=
led
> may easily [...], is confusing

Exactly, example:

> --- a/gnu/services/authentication.scm
> +++ b/gnu/services/authentication.scm
> @@ -218,7 +218,7 @@ (define-configuration nslcd-configuration
> =C2=A0
> =C2=A0=C2=A0 ;; Runtime options
> =C2=A0=C2=A0 (threads
> -=C2=A0=C2=A0 (maybe-number 'disabled)
> +=C2=A0=C2=A0 (maybe-number)
> =C2=A0=C2=A0=C2=A0 "The number of threads to start that can handle reques=
ts and perform LDAP
> =C2=A0queries.=C2=A0 Each thread opens a separate connection to the LDAP =
server.=C2=A0 The
> =C2=A0default is to start 5 threads.")

(threads 'disabled) did not actually disable multi-threading.
FWIW, in this particular case, it could be (threads (number 5) ...)
instead (not using 'disabled' or *unspecified*), but that seems
somewhat a separate matter to me.

Greetings,
Maxime.

--=-ejd8r1ac0OalP6BK5cbw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYkdWnRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7s00AP42ASOIOhCuGAWIiiVEy3KCOTPz
n5CDAWoME+pAUua/rwD/dNU8/58YsSjx0aleSNOcAMe8Kfl423cogn5THlfqiw8=
=xddh
-----END PGP SIGNATURE-----

--=-ejd8r1ac0OalP6BK5cbw--





Information forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Apr 2022 19:28:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 01 15:28:29 2022
Received: from localhost ([127.0.0.1]:43441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1naMwd-0005hG-Vm
	for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:28:29 -0400
Received: from lists.gnu.org ([209.51.188.17]:34712)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <attila.lendvai@HIDDEN>) id 1naMwb-0005h7-FP
 for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 15:28:26 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39756)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <attila.lendvai@HIDDEN>)
 id 1naMwb-0001uB-9P
 for guix-patches@HIDDEN; Fri, 01 Apr 2022 15:28:25 -0400
Received: from [2a00:1450:4864:20::634] (port=38810
 helo=mail-ej1-x634.google.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <attila.lendvai@HIDDEN>)
 id 1naMwX-0003uq-N8
 for guix-patches@HIDDEN; Fri, 01 Apr 2022 15:28:24 -0400
Received: by mail-ej1-x634.google.com with SMTP id r13so7890289ejd.5
 for <guix-patches@HIDDEN>; Fri, 01 Apr 2022 12:28:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=sender:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=HkxpSVgdcHoDv9hITJgm3we+Se9jmO+db10+cmKGz/I=;
 b=BAKJA0FEUxKaFbYVBH4pJYIVGIjN9ti53fkycmW3t+cuqdPSg1tkrd/JGcxcEDlxHK
 fbSKrUT1KVi8x98tFCDynmTqVkMnMnvYHixVM1DlcRDgSlBaSbxiSixyZmm3JdEdX8Yl
 GXwWd4v1+tEO+tZGhVAtYs5AjD49c8BDlBm2aYZbV1+ktySyI/gTnqaD7XYN7zNig6gO
 yM9YRfDMQ9vjAfeyNZ+qDc8BHFYfN9h2neKftg4r2HCMMhFI85S+YpGZNqOoxU+7NSW2
 8zglvnh4IVbIt1x0WX9kCHxVSsSpuG1hXowZdKSGCWLXIVbRVix0yiV1Q16DrQiOsL2d
 LlpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:sender:from:to:cc:subject:date:message-id
 :mime-version:content-transfer-encoding;
 bh=HkxpSVgdcHoDv9hITJgm3we+Se9jmO+db10+cmKGz/I=;
 b=7G8BjdALkMz4dmrwurB7seiSwxlVvSXOM8XzRQNjJWJXGhDcdBfKYWj0ipZlddyK+U
 5oL/8UPG5GZwsO4w77jUn1uoMOtgD81MxEJCJiXfpz22LqKtAOBoFUdUObUV3P2KsCAh
 N+e3GiIUijFemCPxXcsKiJBUTBgOIz51biUT9aIDc4kIiqppESsAsAunQtenx/Bv1naD
 NCqoU7UN1pkBkuaYhv088TKxJs41AXdD+WNx186xBlcnv+TwmIDRvOeJjUth4q5L6SXp
 MWx9rSUh7R6dAaTBHgSh8sH5y+qi85TOVaBKLncOVE6gf/xjEZFI5Mu1v6k+giZHvrnS
 ItKA==
X-Gm-Message-State: AOAM531hwDMZQpoG9vepHD+Jr6K+WaHce28k5hn3vyZoxRcPMBzuQAK7
 VIDlyBIfHyT5MGySaupkvxk+l12o9MI=
X-Google-Smtp-Source: ABdhPJw7B5Mh+b0LsZJJ1ivkqs7bqMYJn3LbKr0xW3uSejSVataIgcPBxxbBJK11FtrKj8KPr0A21g==
X-Received: by 2002:a17:907:608d:b0:6df:f79c:2e67 with SMTP id
 ht13-20020a170907608d00b006dff79c2e67mr1094408ejc.577.1648841297345; 
 Fri, 01 Apr 2022 12:28:17 -0700 (PDT)
Received: from localhost.localdomain ([2a02:ab88:7509:f780:ed82:a496:f55:e07b])
 by smtp.gmail.com with ESMTPSA id
 j21-20020a170906255500b006e08c4862ccsm1341112ejb.96.2022.04.01.12.28.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 01 Apr 2022 12:28:16 -0700 (PDT)
From: Attila Lendvai <attila@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] services: configuration: Use *unspecified* instead of
 'disabled.
Date: Fri,  1 Apr 2022 21:19:58 +0200
Message-Id: <20220401191957.16624-1-attila@HIDDEN>
X-Mailer: git-send-email 2.34.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::634
 (failed)
Received-SPF: pass client-ip=2a00:1450:4864:20::634;
 envelope-from=attila.lendvai@HIDDEN; helo=mail-ej1-x634.google.com
X-Spam_score_int: 0
X-Spam_score: -0.1
X-Spam_bar: /
X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249,
 FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
 PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
Cc: Attila Lendvai <attila@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

...as a marker for field values that have not been set. Rationale: 'disabled
may easily clash with user values for boolean fields, is confusing (i.e. its
meaning is *not* boolean false, bug unspecified) and it also passes through
silently the symbol? predicate of a field of type symbol.

Relax the syntax to accept (field1 (maybe-string) "") forms, in which case it
uses *unspecified* as default value.

Possible future improvement: also accept (field1 maybe-string "") forms,
i.e. without the extra parens around maybe types without defaults.

* gnu/services/configuration.scm (configuration-missing-default-value):
Renamed from configuration-no-default-value.
* gnu/services/configuration.scm (define-maybe-helper): Use *unspecified*
instead of 'disabled, and make the default value optional.
---

i could not test every service that uses define-configuration, but i did
reconfigure my server with this commit, and i have adapted and tested my
swarm service code with it, too.

take it as a request for comments, but it may very well be of good
enough quality for inclusion.

the reason i didn't do the (field1 maybe-string "") syntax *i.e. no
parens around maybe-string), is that i couldn't convince the hygienic
macro system about it.

 gnu/home/services/desktop.scm    | 12 ++---
 gnu/services/authentication.scm  | 82 ++++++++++++++++----------------
 gnu/services/cgit.scm            | 12 ++---
 gnu/services/configuration.scm   | 16 +++----
 gnu/services/file-sharing.scm    | 24 +++++-----
 gnu/services/messaging.scm       | 37 +++++++-------
 gnu/services/networking.scm      | 12 ++---
 gnu/services/pm.scm              | 54 ++++++++++-----------
 gnu/services/telephony.scm       | 14 +++---
 gnu/services/vpn.scm             |  2 +-
 tests/services/configuration.scm | 12 +++++
 11 files changed, 143 insertions(+), 134 deletions(-)

diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm
index cbb9cf76da..a54ad0d115 100644
--- a/gnu/home/services/desktop.scm
+++ b/gnu/home/services/desktop.scm
@@ -91,26 +91,26 @@ (define-configuration home-redshift-configuration
    "Nighttime color temperature (kelvins).")
 
   (daytime-brightness
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Daytime screen brightness, between 0.1 and 1.0.")
   (nighttime-brightness
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Nighttime screen brightness, between 0.1 and 1.0.")
 
   (latitude
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Latitude, when @code{location-provider} is @code{'manual}.")
   (longitude
-   (maybe-inexact-number 'disabled)
+   (maybe-inexact-number)
    "Longitude, when @code{location-provider} is @code{'manual}.")
 
   (dawn-time
-   (maybe-string 'disabled)
+   (maybe-string)
    "Custom time for the transition from night to day in the
 morning---@code{\"HH:MM\"} format.  When specified, solar elevation is not
 used to determine the daytime/nighttime period.")
   (dusk-time
-   (maybe-string 'disabled)
+   (maybe-string)
    "Likewise, custom time for the transition from day to night in the
 evening.")
 
diff --git a/gnu/services/authentication.scm b/gnu/services/authentication.scm
index cb0ef6d85a..1c4800bfbd 100644
--- a/gnu/services/authentication.scm
+++ b/gnu/services/authentication.scm
@@ -218,7 +218,7 @@ (define-configuration nslcd-configuration
 
   ;; Runtime options
   (threads
-   (maybe-number 'disabled)
+   (maybe-number)
    "The number of threads to start that can handle requests and perform LDAP
 queries.  Each thread opens a separate connection to the LDAP server.  The
 default is to start 5 threads.")
@@ -243,45 +243,45 @@ (define-configuration nslcd-configuration
    "The list of LDAP server URIs.  Normally, only the first server will be
 used with the following servers as fall-back.")
   (ldap-version
-   (maybe-string 'disabled)
+   (maybe-string)
    "The version of the LDAP protocol to use.  The default is to use the
 maximum version supported by the LDAP library.")
   (binddn
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the distinguished name with which to bind to the directory
 server for lookups.  The default is to bind anonymously.")
   (bindpw
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the credentials with which to bind.  This option is only
 applicable when used with binddn.")
   (rootpwmoddn
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the distinguished name to use when the root user tries to modify
 a user's password using the PAM module.")
   (rootpwmodpw
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the credentials with which to bind if the root user tries to
 change a user's password.  This option is only applicable when used with
 rootpwmoddn")
 
   ;; SASL authentication options
   (sasl-mech
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the SASL mechanism to be used when performing SASL
 authentication.")
   (sasl-realm
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the SASL realm to be used when performing SASL authentication.")
   (sasl-authcid
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the authentication identity to be used when performing SASL
 authentication.")
   (sasl-authzid
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the authorization identity to be used when performing SASL
 authentication.")
   (sasl-canonicalize?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Determines whether the LDAP server host name should be canonicalised.  If
 this is enabled the LDAP library will do a reverse host name lookup.  By
 default, it is left up to the LDAP library whether this check is performed or
@@ -289,7 +289,7 @@ (define-configuration nslcd-configuration
 
   ;; Kerberos authentication options
   (krb5-ccname
-   (maybe-string 'disabled)
+   (maybe-string)
    "Set the name for the GSS-API Kerberos credentials cache.")
 
   ;; Search / mapping options
@@ -302,11 +302,11 @@ (define-configuration nslcd-configuration
 default scope is subtree; base scope is almost never useful for name service
 lookups; children scope is not supported on all servers.")
   (deref
-   (maybe-deref-option 'disabled)
+   (maybe-deref-option)
    "Specifies the policy for dereferencing aliases.  The default policy is to
 never dereference aliases.")
   (referrals
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Specifies whether automatic referral chasing should be enabled.  The
 default behaviour is to chase referrals.")
   (maps
@@ -322,132 +322,132 @@ (define-configuration nslcd-configuration
 
   ;; Timing / reconnect options
   (bind-timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time limit in seconds to use when connecting to the
 directory server.  The default value is 10 seconds.")
   (timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time limit (in seconds) to wait for a response from the LDAP
 server.  A value of zero, which is the default, is to wait indefinitely for
 searches to be completed.")
   (idle-timelimit
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the period if inactivity (in seconds) after which the con‐
 nection to the LDAP server will be closed.  The default is not to time out
 connections.")
   (reconnect-sleeptime
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the number of seconds to sleep when connecting to all LDAP
 servers fails.  By default one second is waited between the first failure and
 the first retry.")
   (reconnect-retrytime
-   (maybe-number 'disabled)
+   (maybe-number)
    "Specifies the time after which the LDAP server is considered to be
 permanently unavailable.  Once this time is reached retries will be done only
 once per this time period.  The default value is 10 seconds.")
 
   ;; TLS options
   (ssl
-   (maybe-ssl-option 'disabled)
+   (maybe-ssl-option)
    "Specifies whether to use SSL/TLS or not (the default is not to).  If
 'start-tls is specified then StartTLS is used rather than raw LDAP over SSL.")
   (tls-reqcert
-   (maybe-tls-reqcert-option 'disabled)
+   (maybe-tls-reqcert-option)
    "Specifies what checks to perform on a server-supplied certificate.
 The meaning of the values is described in the ldap.conf(5) manual page.")
   (tls-cacertdir
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the directory containing X.509 certificates for peer authen‐
 tication.  This parameter is ignored when using GnuTLS.")
   (tls-cacertfile
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the X.509 certificate for peer authentication.")
   (tls-randfile
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to an entropy source.  This parameter is ignored when
 using GnuTLS.")
   (tls-ciphers
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the ciphers to use for TLS as a string.")
   (tls-cert
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the file containing the local certificate for client
 TLS authentication.")
   (tls-key
-   (maybe-string 'disabled)
+   (maybe-string)
    "Specifies the path to the file containing the private key for client TLS
 authentication.")
 
   ;; Other options
   (pagesize
-   (maybe-number 'disabled)
+   (maybe-number)
    "Set this to a number greater than 0 to request paged results from the LDAP
 server in accordance with RFC2696.  The default (0) is to not request paged
 results.")
   (nss-initgroups-ignoreusers
-   (maybe-ignore-users-option 'disabled)
+   (maybe-ignore-users-option)
    "This option prevents group membership lookups through LDAP for the
 specified users.  Alternatively, the value 'all-local may be used.  With that
 value nslcd builds a full list of non-LDAP users on startup.")
   (nss-min-uid
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option ensures that LDAP users with a numeric user id lower than the
 specified value are ignored.")
   (nss-uid-offset
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option specifies an offset that is added to all LDAP numeric user
 ids.  This can be used to avoid user id collisions with local users.")
   (nss-gid-offset
-   (maybe-number 'disabled)
+   (maybe-number)
    "This option specifies an offset that is added to all LDAP numeric group
 ids.  This can be used to avoid user id collisions with local groups.")
   (nss-nested-groups
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, the member attribute of a group may point to
 another group.  Members of nested groups are also returned in the higher level
 group and parent groups are returned when finding groups for a specific user.
 The default is not to perform extra searches for nested groups.")
   (nss-getgrent-skipmembers
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, the group member list is not retrieved when looking
 up groups.  Lookups for finding which groups a user belongs to will remain
 functional so the user will likely still get the correct groups assigned on
 login.")
   (nss-disable-enumeration
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "If this option is set, functions which cause all user/group entries to be
 loaded from the directory will not succeed in doing so.  This can dramatically
 reduce LDAP server load in situations where there are a great number of users
 and/or groups.  This option is not recommended for most configurations.")
   (validnames
-   (maybe-string 'disabled)
+   (maybe-string)
    "This option can be used to specify how user and group names are verified
 within the system.  This pattern is used to check all user and group names
 that are requested and returned from LDAP.")
   (ignorecase
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "This specifies whether or not to perform searches using case-insensitive
 matching.  Enabling this could open up the system to authorization bypass
 vulnerabilities and introduce nscd cache poisoning vulnerabilities which allow
 denial of service.")
   (pam-authc-ppolicy
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "This option specifies whether password policy controls are requested and
 handled from the LDAP server when performing user authentication.")
   (pam-authc-search
-   (maybe-string 'disabled)
+   (maybe-string)
    "By default nslcd performs an LDAP search with the user's credentials after
 BIND (authentication) to ensure that the BIND operation was successful.  The
 default search is a simple check to see if the user's DN exists.  A search
 filter can be specified that will be used instead.  It should return at least
 one entry.")
   (pam-authz-search
-   (maybe-string 'disabled)
+   (maybe-string)
    "This option allows flexible fine tuning of the authorisation check that
 should be performed.  The search filter specified is executed and if any
 entries match, access is granted, otherwise access is denied.")
   (pam-password-prohibit-message
-   (maybe-string 'disabled)
+   (maybe-string)
    "If this option is set password modification using pam_ldap will be denied
 and the specified message will be presented to the user instead.  The message
 can be used to direct the user to an alternative means of changing their
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index bfc89a40a4..bcb3e1a796 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -241,27 +241,27 @@ (define-configuration repository-cgit-configuration
    (repo-file-object "")
    "Override the default @code{email-filter}.")
   (enable-commit-graph?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-commit-graph?}.")
   (enable-log-filecount?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-log-filecount?}.")
   (enable-log-linecount?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to disable the global setting
 @code{enable-log-linecount?}.")
   (enable-remote-branches?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "Flag which, when set to @code{#t}, will make cgit display remote
 branches in the summary and refs views.")
   (enable-subject-links?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to override the global setting
 @code{enable-subject-links?}.")
   (enable-html-serving?
-   (maybe-repo-boolean 'disabled)
+   (maybe-repo-boolean)
    "A flag which can be used to override the global setting
 @code{enable-html-serving?}.")
   (hide?
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 0de350a4df..325ef6e0ac 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -92,7 +92,7 @@ (define (configuration-field-error field val)
 (define (configuration-missing-field kind field)
   (configuration-error
    (format #f "~a configuration missing required field ~a" kind field)))
-(define (configuration-no-default-value kind field)
+(define (configuration-missing-default-value kind field)
   (configuration-error
    (format #f "The field `~a' of the `~a' configuration record \
 does not have a default value" field kind)))
@@ -141,7 +141,8 @@ (define (define-maybe-helper serialize? prefix syn)
                                     (id #'stem #'serialize-maybe- #'stem))))
        #`(begin
            (define (maybe-stem? val)
-             (or (eq? val 'disabled) (stem? val)))
+             (or (unspecified? val)
+                 (stem? val)))
            #,@(if serialize?
                   (list #'(define (serialize-maybe-stem field-name val)
                             (if (stem? val)
@@ -178,9 +179,7 @@ (define (define-configuration-helper serialize? serializer-prefix syn)
     			   ((field-type default-value)
                             default-value)
     			   ((field-type)
-                            ;; Quote `undefined' to prevent a possibly
-                            ;; unbound warning.
-                            (syntax 'undefined)))
+                            (syntax *unspecified*)))
     			 #'((field-type def ...) ...)))
                    ((field-serializer ...)
                     (map (lambda (type custom-serializer)
@@ -206,7 +205,7 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
     					source-properties->location))
     			(innate))
     	     #,@(map (lambda (name getter def)
-    		       (if (eq? (syntax->datum def) (quote 'undefined))
+    		       (if (unspecified? (syntax->datum def))
     			   #`(#,name #,getter)
     			   #`(#,name #,getter (default #,def))))
     		     #'(field ...)
@@ -222,9 +221,8 @@ (define #,(id #'stem #'stem #'-fields)
     		    (default-value-thunk
     		      (lambda ()
     			(display '#,(id #'stem #'% #'stem))
-    			(if (eq? (syntax->datum field-default)
-    				 'undefined)
-    			    (configuration-no-default-value
+    			(if (unspecified? (syntax->datum field-default))
+    			    (configuration-missing-default-value
     			     '#,(id #'stem #'% #'stem) 'field)
     			    field-default)))
     		    (documentation doc))
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index e3d681b08f..6e71fa9154 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -115,8 +115,7 @@ (define-maybe string)
 (set! serialize-maybe-string
   (lambda (field-name val)
     (serialize-string field-name
-                      (if (and (symbol? val)
-                               (eq? val 'disabled))
+                      (if (unspecified? val)
                           ""
                           val))))
 
@@ -181,8 +180,7 @@ (define (serialize-file-object field-name val)
 (define-maybe file-object)
 (set! serialize-maybe-file-object
   (lambda (field-name val)
-    (if (and (symbol? val)
-             (eq? val 'disabled))
+    (if (unspecified? val)
         (serialize-string field-name "")
         (serialize-file-object field-name val))))
 
@@ -281,7 +279,7 @@ (define-configuration transmission-daemon-configuration
 torrent is complete.  Otherwise, files for all torrents (including those still
 being downloaded) will be placed in @code{download-dir}.")
   (incomplete-dir
-   (maybe-string 'disabled)
+   (maybe-string)
    "The directory in which files from incompletely downloaded torrents will be
 held when @code{incomplete-dir-enabled?} is @code{#t}.")
   (umask
@@ -305,7 +303,7 @@ (define-configuration transmission-daemon-configuration
 automatically (and the original files removed, if
 @code{trash-original-torrent-files?} is @code{#t}).")
   (watch-dir
-   (maybe-string 'disabled)
+   (maybe-string)
    "The directory to be watched for @file{.torrent} files indicating new
 torrents to be added, when @code{watch-dir-enabled} is @code{#t}.")
   (trash-original-torrent-files?
@@ -401,11 +399,11 @@ (define-configuration transmission-daemon-configuration
 @code{prefer-unencrypted-connections}, @code{prefer-encrypted-connections} or
 @code{require-encrypted-connections}.")
   (peer-congestion-algorithm
-   (maybe-string 'disabled)
+   (maybe-string)
    "The TCP congestion-control algorithm to use for peer connections,
 specified using a string recognized by the operating system in calls to
-@code{setsockopt} (or set to @code{disabled}, in which case the
-operating-system default is used).
+@code{setsockopt} (or leave it unset, in which case the operating-system
+default is used).
 
 Note that on GNU/Linux systems, the kernel must be configured to allow
 processes to use a congestion-control algorithm not in the default set;
@@ -465,7 +463,7 @@ (define-configuration transmission-daemon-configuration
    "When @code{#t}, the daemon will ignore peers mentioned in the blocklist it
 has most recently downloaded from @code{blocklist-url}.")
   (blocklist-url
-   (maybe-string 'disabled)
+   (maybe-string)
    "The URL of a peer blocklist (in @acronym{P2P}-plaintext or eMule
 @file{.dat} format) to be periodically downloaded and applied when
 @code{blocklist-enabled?} is @code{#t}.")
@@ -564,11 +562,11 @@ (define-configuration transmission-daemon-configuration
 the side effect of disabling host-name whitelisting (see
 @code{rpc-host-whitelist-enabled?}.")
   (rpc-username
-   (maybe-string 'disabled)
+   (maybe-string)
    "The username required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.")
   (rpc-password
-   (maybe-transmission-password-hash 'disabled)
+   (maybe-transmission-password-hash)
    "The password required by clients to access the @acronym{RPC} interface
 when @code{rpc-authentication-required?} is @code{#t}.  This must be specified
 using a password hash in the format recognized by Transmission clients, either
@@ -613,7 +611,7 @@ (define-configuration transmission-daemon-configuration
 @code{script-torrent-done-filename} will be invoked each time a torrent
 completes.")
   (script-torrent-done-filename
-   (maybe-file-object 'disabled)
+   (maybe-file-object)
    "A file name or file-like object specifying a script to run each time a
 torrent completes, when @code{script-torrent-done-enabled?} is @code{#t}.")
   (scrape-paused-torrents-enabled?
diff --git a/gnu/services/messaging.scm b/gnu/services/messaging.scm
index 4bceb1d37a..5f20d768ef 100644
--- a/gnu/services/messaging.scm
+++ b/gnu/services/messaging.scm
@@ -72,6 +72,7 @@ (define (make-pred arg)
       (lambda (field target)
         (and (memq (syntax->datum target) `(common ,arg)) field)))
     (syntax-case stx ()
+      ;; TODO Also handle (field-type) form, without a default.
       ((_ stem (field (field-type def) doc target) ...)
        (with-syntax (((new-field-type ...)
                       (map (lambda (field-type target)
@@ -85,7 +86,7 @@ (define (make-pred arg)
                      ((new-def ...)
                       (map (lambda (def target)
                              (if (eq? 'common (syntax->datum target))
-                                 #''disabled def))
+                                 #'*unspecified* def))
                            #'(def ...) #'(target ...)))
                      ((new-doc ...)
                       (map (lambda (doc target)
@@ -195,7 +196,7 @@ (define (serialize-file-object-list field-name val)
 (define-maybe file-object-list)
 
 (define (raw-content? val)
-  (not (eq? val 'disabled)))
+  (not (unspecified? val)))
 (define (serialize-raw-content field-name val)
   val)
 (define-maybe raw-content)
@@ -223,15 +224,15 @@ (define-maybe mod-muc-configuration)
 
 (define-configuration ssl-configuration
   (protocol
-   (maybe-string 'disabled)
+   (maybe-string)
    "This determines what handshake to use.")
 
   (key
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "Path to your private key file.")
 
   (certificate
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "Path to your certificate file.")
 
   (capath
@@ -240,48 +241,48 @@ (define-configuration ssl-configuration
 trust when verifying the certificates of remote servers.")
 
   (cafile
-   (maybe-file-object 'disabled)
+   (maybe-file-object)
    "Path to a file containing root certificates that you wish Prosody to trust.
 Similar to @code{capath} but with all certificates concatenated together.")
 
   (verify
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of verification options (these mostly map to OpenSSL's
 @code{set_verify()} flags).")
 
   (options
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of general options relating to SSL/TLS.  These map to OpenSSL's
 @code{set_options()}.  For a full list of options available in LuaSec, see the
 LuaSec source.")
 
   (depth
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "How long a chain of certificate authorities to check when looking for a
 trusted root certificate.")
 
   (ciphers
-   (maybe-string 'disabled)
+   (maybe-string)
    "An OpenSSL cipher string.  This selects what ciphers Prosody will offer to
 clients, and in what order.")
 
   (dhparam
-   (maybe-file-name 'disabled)
+   (maybe-file-name)
    "A path to a file containing parameters for Diffie-Hellman key exchange.  You
 can create such a file with:
 @code{openssl dhparam -out /etc/prosody/certs/dh-2048.pem 2048}")
 
   (curve
-   (maybe-string 'disabled)
+   (maybe-string)
    "Curve for Elliptic curve Diffie-Hellman. Prosody's default is
 @samp{\"secp384r1\"}.")
 
   (verifyext
-   (maybe-string-list 'disabled)
+   (maybe-string-list)
    "A list of \"extra\" verification options.")
 
   (password
-   (maybe-string 'disabled)
+   (maybe-string)
    "Password for encrypted private keys."))
 (define (serialize-ssl-configuration field-name val)
   #~(format #f "ssl = {\n~a};\n"
@@ -469,12 +470,12 @@ (define-all-configurations prosody-configuration
      global)
 
     (http-max-content-size
-     (maybe-non-negative-integer 'disabled)
+     (maybe-non-negative-integer *unspecified*)
      "Maximum allowed size of the HTTP body (in bytes)."
      common)
 
     (http-external-url
-     (maybe-string 'disabled)
+     (maybe-string *unspecified*)
      "Some modules expose their own URL in various ways.  This URL is built
 from the protocol, host and port used.  If Prosody sits behind a proxy, the
 public URL will be @code{http-external-url} instead.  See
@@ -551,7 +552,7 @@ (define-all-configurations prosody-configuration
      int-component)
 
     (mod-muc
-     (maybe-mod-muc-configuration 'disabled)
+     (maybe-mod-muc-configuration *unspecified*)
      "Multi-user chat (MUC) is Prosody's module for allowing you to create
 hosted chatrooms/conferences for XMPP users.
 
@@ -568,7 +569,7 @@ (define-all-configurations prosody-configuration
      ext-component)
 
     (raw-content
-     (maybe-raw-content 'disabled)
+     (maybe-raw-content *unspecified*)
      "Raw content that will be added to the configuration file."
      common)))
 
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 5bb8638930..b5c46218e7 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -763,17 +763,17 @@ (define-configuration/no-serialization opendht-configuration
    "The node host name that is used to make the first connection to the
 network.  A specific port value can be provided by appending the @code{:PORT}
 suffix.  By default, it uses the Jami bootstrap nodes, but any host can be
-specified here.  It's also possible to disable bootstrapping by setting this
-to the @code{'disabled} symbol.")
+specified here.  It's also possible to disable bootstrapping by explicitly
+setting this field to the @code{*unspecified*} value.")
   (port
    (maybe-number 4222)
-   "The UDP port to bind to.  When set to @code{'disabled}, an available port
-is automatically selected.")
+   "The UDP port to bind to.  When set to @code{*unspecified*}, an available
+port is automatically selected.")
   (proxy-server-port
-   (maybe-number 'disabled)
+   (maybe-number)
    "Spawn a proxy server listening on the specified port.")
   (proxy-server-port-tls
-   (maybe-number 'disabled)
+   (maybe-number)
    "Spawn a proxy server listening to TLS connections on the specified
 port."))
 
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index e48236dbca..d1250ab488 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -114,55 +114,55 @@ (define-configuration tlp-configuration
    "Same as @code{max-lost-work-secs-on-ac} but on BAT mode.")
 
   (cpu-scaling-governor-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "CPU frequency scaling governor on AC mode.  With intel_pstate
 driver, alternatives are powersave and performance.  With acpi-cpufreq driver,
 alternatives are ondemand, powersave, performance and conservative.")
 
   (cpu-scaling-governor-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Same as @code{cpu-scaling-governor-on-ac} but on BAT mode.")
 
   (cpu-scaling-min-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the min available frequency for the scaling governor on AC.")
 
   (cpu-scaling-max-freq-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the max available frequency for the scaling governor on AC.")
 
   (cpu-scaling-min-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the min available frequency for the scaling governor on BAT.")
 
   (cpu-scaling-max-freq-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Set the max available frequency for the scaling governor on BAT.")
 
   (cpu-min-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Limit the min P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-max-perf-on-ac
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Limit the max P-state to control the power dissipation of the CPU,
 in AC mode.  Values are stated as a percentage of the available performance.")
 
   (cpu-min-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Same as @code{cpu-min-perf-on-ac} on BAT mode.")
 
   (cpu-max-perf-on-bat
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Same as @code{cpu-max-perf-on-ac} on BAT mode.")
 
   (cpu-boost-on-ac?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Enable CPU turbo boost feature on AC mode.")
 
   (cpu-boost-on-bat?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Same as @code{cpu-boost-on-ac?} on BAT mode.")
 
   (sched-powersave-on-ac?
@@ -179,7 +179,7 @@ (define-configuration tlp-configuration
    "Enable Linux kernel NMI watchdog.")
 
   (phc-controls
-   (maybe-string 'disabled)
+   (maybe-string)
    "For Linux kernels with PHC patch applied, change CPU voltages.
 An example value would be @samp{\"F:V F:V F:V F:V\"}.")
 
@@ -205,16 +205,16 @@ (define-configuration tlp-configuration
    "Same as @code{disk-apm-bat} but on BAT mode.")
 
   (disk-spindown-timeout-on-ac
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Hard disk spin down timeout.  One value has to be specified for
 each declared hard disk.")
 
   (disk-spindown-timeout-on-bat
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Same as @code{disk-spindown-timeout-on-ac} but on BAT mode.")
 
   (disk-iosched
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Select IO scheduler for disk devices.  One value has to be specified
 for each declared hard disk.  Example alternatives are cfq, deadline and noop.")
 
@@ -228,16 +228,16 @@ (define-configuration tlp-configuration
    "Same as @code{sata-linkpwr-ac} but on BAT mode.")
 
   (sata-linkpwr-blacklist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Exclude specified SATA host devices for link power management.")
 
   (ahci-runtime-pm-on-ac?
-   (maybe-on-off-boolean 'disabled)
+   (maybe-on-off-boolean)
    "Enable Runtime Power Management for AHCI controller and disks
 on AC mode.")
 
   (ahci-runtime-pm-on-bat?
-   (maybe-on-off-boolean 'disabled)
+   (maybe-on-off-boolean)
    "Same as @code{ahci-runtime-pm-on-ac} on BAT mode.")
 
   (ahci-runtime-pm-timeout
@@ -254,19 +254,19 @@ (define-configuration tlp-configuration
    "Same as @code{pcie-aspm-ac} but on BAT mode.")
 
   (start-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 0 should begin charging.")
 
   (stop-charge-thresh-bat0
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 0 should stop charging.")
 
   (start-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 1 should begin charging.")
 
   (stop-charge-thresh-bat1
-   (maybe-non-negative-integer 'disabled)
+   (maybe-non-negative-integer)
    "Percentage when battery 1 should stop charging.")
 
   (radeon-power-profile-on-ac
@@ -346,7 +346,7 @@ (define-configuration tlp-configuration
 blacklisted ones.")
 
   (runtime-pm-blacklist
-   (maybe-space-separated-string-list 'disabled)
+   (maybe-space-separated-string-list)
    "Exclude specified PCI(e) device addresses from Runtime Power Management.")
 
   (runtime-pm-driver-blacklist
@@ -359,7 +359,7 @@ (define-configuration tlp-configuration
    "Enable USB autosuspend feature.")
 
   (usb-blacklist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Exclude specified devices from USB autosuspend.")
 
   (usb-blacklist-wwan?
@@ -367,12 +367,12 @@ (define-configuration tlp-configuration
    "Exclude WWAN devices from USB autosuspend.")
 
   (usb-whitelist
-   (maybe-string 'disabled)
+   (maybe-string)
    "Include specified devices into USB autosuspend, even if they are
 already excluded by the driver or via @code{usb-blacklist-wwan?}.")
 
   (usb-autosuspend-disable-on-shutdown?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Enable USB autosuspend before shutdown.")
 
   (restore-device-state-on-startup?
diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 157d96abd6..c153cb37c3 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -155,7 +155,7 @@ (define-configuration jami-account
 secret key material of the Jami account it contains."
    empty-serializer)
   (allowed-contacts
-   (maybe-account-fingerprint-list 'disabled)
+   (maybe-account-fingerprint-list)
    "The list of allowed contacts for the account, entered as their 40
 characters long fingerprint.  Messages or calls from accounts not in that list
 will be rejected.  When unspecified, the configuration of the account archive
@@ -164,7 +164,7 @@ (define-configuration jami-account
 the account."
    empty-serializer)
   (moderators
-   (maybe-account-fingerprint-list 'disabled)
+   (maybe-account-fingerprint-list)
    "The list of contacts that should have moderation privileges (to ban, mute,
 etc. other users) in rendezvous conferences, entered as their 40 characters
 long fingerprint.  When unspecified, the configuration of the account archive
@@ -173,24 +173,24 @@ (define-configuration jami-account
    empty-serializer)
   ;; The serializable fields below are to be set with set-account-details.
   (rendezvous-point?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Whether the account should operate in the rendezvous mode.  In this mode,
 all the incoming audio/video calls are mixed into a conference.  When left
 unspecified, the value from the account archive prevails.")
   (peer-discovery?
-   (maybe-boolean 'disabled)
+   (maybe-boolean)
    "Whether peer discovery should be enabled.  Peer discovery is used to
 discover other OpenDHT nodes on the local network, which can be useful to
 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 'disabled)
+   (maybe-string-list)
    "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.")
   (name-server-uri
-   (maybe-string 'disabled)
+   (maybe-string)
    "The URI of the name server to use, that can be used to retrieve the
 account fingerprint for a registered username."))
 
@@ -245,7 +245,7 @@ (define-configuration/no-serialization jami-configuration
    (boolean #f)
    "Whether to force automatic answer to incoming calls.")
   (accounts
-   (maybe-jami-account-list 'disabled)
+   (maybe-jami-account-list)
    "A list of Jami accounts to be (re-)provisioned every time the Jami daemon
 service starts.  When providing this field, the account directories under
 @file{/var/lib/jami/} are recreated every time the service starts, ensuring a
diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm
index b24e9cffb3..133a5ad9bf 100644
--- a/gnu/services/vpn.scm
+++ b/gnu/services/vpn.scm
@@ -363,7 +363,7 @@ (define-split-configuration openvpn-client-configuration
 channel to protect against DoS attacks.")
 
    (auth-user-pass
-     (maybe-string 'disabled)
+    (maybe-string)
      "Authenticate with server using username/password.  The option is a file
 containing username/password on 2 lines.  Do not use a file-like object as it
 would be added to the store and readable by any user.")
diff --git a/tests/services/configuration.scm b/tests/services/configuration.scm
index 86a36a388d..8f32ad1dfc 100644
--- a/tests/services/configuration.scm
+++ b/tests/services/configuration.scm
@@ -118,3 +118,15 @@ (define-configuration config-with-maybe-string/no-serialization
 
 (test-assert "maybe value without serialization no procedure bound"
   (not (defined? 'serialize-maybe-string)))
+
+(test-assert "maybe type, no default"
+  (unspecified?
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization))))
+
+(test-assert "maybe type, with default"
+  (equal?
+   "foo"
+   (config-with-maybe-string/no-serialization-name
+    (config-with-maybe-string/no-serialization
+     (name "foo")))))
-- 
2.34.0





Acknowledgement sent to Attila Lendvai <attila@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#54674; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 17 May 2022 11:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.