all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 57168@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#57168] [PATCH 01/14] services: configuration: Add a 'maybe-value-set?' procedure.
Date: Sat, 13 Aug 2022 02:54:20 -0400	[thread overview]
Message-ID: <20220813065433.27319-1-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20220813065006.27151-1-maxim.cournoyer@gmail.com>

* gnu/services/configuration.scm (maybe-value-set?): New procedure.
* doc/guix.texi (Complex Configurations): Document it.  Remove comment showing
usage of 'maybe-string' with a default value, which doesn't make sense.
---
 doc/guix.texi                  | 7 ++++++-
 gnu/services/configuration.scm | 5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 86cfe7d49c..039df29ebc 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -38999,7 +38999,7 @@ to be a string, or left unspecified.
   (name
    ;; 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*)
+   maybe-string
    "The name of this module."))
 @end lisp
 
@@ -39030,6 +39030,11 @@ whether its value is set or not.
 @end lisp
 @end deffn
 
+@deffn (Scheme Procedure) maybe-value-set? @var{value}
+Predicate to check whether a user explicitly specified the value of a
+maybe field.
+@end deffn
+
 @deffn {Scheme Procedure} serialize-configuration @var{configuration} @
 @var{fields}
 Return a G-expression that contains the values corresponding to the
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 3007e8de35..b41b4d2e62 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -57,6 +57,7 @@ (define-module (gnu services configuration)
             serialize-configuration
             define-maybe
             define-maybe/no-serialization
+            maybe-value-set?
             generate-documentation
             configuration->documentation
             empty-serializer
@@ -300,6 +301,10 @@ (define-configuration stem (field field-type+def
 (define (empty-serializer field-name val) "")
 (define serialize-package empty-serializer)
 
+(define (maybe-value-set? value)
+  "Predicate to check whether a 'maybe' value was explicitly provided."
+  (not (eq? 'unset value)))
+
 ;; A little helper to make it easier to document all those fields.
 (define (generate-documentation documentation documentation-name)
   (define (str x) (object->string x))
-- 
2.36.1





  reply	other threads:[~2022-08-13  6:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13  6:50 [bug#57168] [PATCH 00/14] Add a LightDM service Maxim Cournoyer
2022-08-13  6:54 ` Maxim Cournoyer [this message]
2022-08-13  6:54   ` [bug#57168] [PATCH 02/14] gnu: accountsservice: Update to 22.08.8, enable doc and test suite Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 03/14] gnu: accountsservice: Provide a means to locate extensions Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 04/14] gnu: lightdm-gtk-greeter: Add GDK_PIXBUF_MODULE_FILE to wrapper Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 05/14] gnu: lightdm-gtk-greeter: Use the glib-or-gtk-wrap phase as-is Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 06/14] gnu: lightdm-gtk-greeter: Enable libklavier support Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 07/14] gnu: lightdm-gtk-greeter: Adjust default config file path Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 08/14] gnu: lightdm-gtk-greeter: Adjust --enable-at-spi-command value Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 09/14] gnu: lightdm: Apply patch to fix a problem with VNC integration Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 10/14] gnu: lightdm: Apply patch to allow using VNC options Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 11/14] gnu: lightdm: Apply patch to fix color depth issue with VNC Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 12/14] marionette: Improve the error message of 'wait-for-screen-text' Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 13/14] build: marionette: Add support for Tesseract OCR Maxim Cournoyer
2022-08-13  6:54   ` [bug#57168] [PATCH 14/14] services: Add lightdm-service-type Maxim Cournoyer
2022-08-26 16:54     ` Maxime Devos
2022-08-29  2:33       ` bug#57168: [PATCH 00/14] Add a LightDM service Maxim Cournoyer
2022-08-30 19:44         ` [bug#57168] " Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220813065433.27319-1-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=57168@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.