From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yLGCDTv4BmN2SgAAbAwnHQ (envelope-from ) for ; Thu, 25 Aug 2022 06:19:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WDjCDDv4BmNL5wAAG6o9tA (envelope-from ) for ; Thu, 25 Aug 2022 06:19:07 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D64A3F65F for ; Thu, 25 Aug 2022 06:19:06 +0200 (CEST) Received: from localhost ([::1]:34374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR4Kf-0008Rv-QX for larch@yhetil.org; Thu, 25 Aug 2022 00:19:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR4Kd-0008Q9-2g for bug-guix@gnu.org; Thu, 25 Aug 2022 00:19:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oR4Kc-00064e-Qc for bug-guix@gnu.org; Thu, 25 Aug 2022 00:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oR4Kc-0003Dy-G5 for bug-guix@gnu.org; Thu, 25 Aug 2022 00:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#56799: (gnu services configuration) usage of *unspecified* is problematic Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 25 Aug 2022 04:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56799 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: 56799-done@debbugs.gnu.org Received: via spool by 56799-done@debbugs.gnu.org id=D56799.166140112912376 (code D ref 56799); Thu, 25 Aug 2022 04:19:02 +0000 Received: (at 56799-done) by debbugs.gnu.org; 25 Aug 2022 04:18:49 +0000 Received: from localhost ([127.0.0.1]:48575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR4KO-0003DX-SK for submit@debbugs.gnu.org; Thu, 25 Aug 2022 00:18:49 -0400 Received: from mail-qv1-f44.google.com ([209.85.219.44]:33560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR4KJ-0003DH-Hr for 56799-done@debbugs.gnu.org; Thu, 25 Aug 2022 00:18:47 -0400 Received: by mail-qv1-f44.google.com with SMTP id d1so14507940qvs.0 for <56799-done@debbugs.gnu.org>; Wed, 24 Aug 2022 21:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc; bh=Cy0U+34yxKon6k2ziBZyUGIJVOLduTw4nkx+k+8gC78=; b=cwHU+8GpljognBMmzDCbF2ynNZA126O8+Ma86CoUf2jCkndc4OEfDPfwQcy3JglnuX EIUtoCfCBurO0FmB0N1ECNHz/MPJ4A09poWX0nvuggTkiejpSxmljPuckpBBrtZ7NPhR en0Fnl/NNEIbGd5JfgOsybFO8ZUEj9G90mKv5LPMXkw4HPa99EewdEFbFMTqneXWDX6P aQyja8AMOLDKMBRmnigZi5xzKqLTztKkRiliVnWb4ZPlp5EIpol7LhmACEycHyPcI2Ux MsM+kXYju/YrX1w+LsrOR/d7JCvZCP9pOWKFUGQR879eDpufGho1LVVd+fHEFrjJWg0b RIWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc; bh=Cy0U+34yxKon6k2ziBZyUGIJVOLduTw4nkx+k+8gC78=; b=LCPc++50i2Nf73DDi01QjyK65hLD652d+Luzz1IUZrMOg12rSmVdeO4TMOAF0mBQF1 oI2Tvof/QoUfQyMFKpWDayIHVzbdjnmPDmgjDJ/ZMYrSs5CjMPstnHCc9cML7T1GVKnI 8PUHK6rKwaMM86sL31/pfgvAZaESInlkbUEWV9HZ7GHkPPZs+Mb2TE2GUkmTI4HJyqr+ yY4EVo8dY3IjGg1hQx9C3rC3bo3y51NVpa+TG8YYxXXD0+CWrmNQXCiUzZo6HtmIJjyj w7A+r9ci4RYQze1RbXIgDqoLI2j8J28v8du/GRQvtwMyOX8Ru8BFxCgwbEEhuB6mmUMc gCTQ== X-Gm-Message-State: ACgBeo0S3zCoifPHFyt0y7A1dbF6Sno5zQIXUcrdX/etnlsUu5T1fTu/ a+NUFP+USgoKzfHxxnJ7Gpg41XwYfe8= X-Google-Smtp-Source: AA6agR5ULQLN/3fYMMlZwa02N/9spQ/nmOAb6TwLcUWmwvxWaV8QnGJFhLVMyZXQvfj5IQSbtEGTNQ== X-Received: by 2002:ad4:5d6a:0:b0:476:cf69:fa18 with SMTP id fn10-20020ad45d6a000000b00476cf69fa18mr2137787qvb.22.1661401117726; Wed, 24 Aug 2022 21:18:37 -0700 (PDT) Received: from hurd (dsl-10-129-95.b2b2c.ca. [72.10.129.95]) by smtp.gmail.com with ESMTPSA id t13-20020a05622a01cd00b00342f8143599sm14224738qtw.13.2022.08.24.21.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 21:18:37 -0700 (PDT) From: Maxim Cournoyer References: <20220824124042.10959-1-attila@lendvai.name> <20220824124042.10959-4-attila@lendvai.name> Date: Thu, 25 Aug 2022 00:18:36 -0400 In-Reply-To: <20220824124042.10959-4-attila@lendvai.name> (Attila Lendvai's message of "Wed, 24 Aug 2022 14:40:41 +0200") Message-ID: <874jy1ez1f.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661401147; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Cy0U+34yxKon6k2ziBZyUGIJVOLduTw4nkx+k+8gC78=; b=PXb483NkWhBxjpxdA9bcSNmqAGuiX+0cbh51ckdAqkiECnjDU3ThXLU9hMrUv9OfV24eZy 4RBetjxoE43No32O9jENNKxmAneiCqgUUfViS7OMaXuHWuwmVT85H8re/nQc7179HSiKcs TWFZL6OXrh7qh72b+4BokDlRMR8bJ8BWuQHOs2F26pdsl6sggStnxAL64B6WGsVd/3uK35 XjLftDnhHli6Mxia8Yo9Xjw+1DlJuw66NMp31lQVwMD6GTfU7EBBESscrk0xmWz8LdgcVC r6xJAqJcPEVkbM1dgz1ocSv8ic7LWG18oC81dwn4xOKB68E7xZqnZFDqrcytFg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661401147; a=rsa-sha256; cv=none; b=A2qxi5XcK828d1xpRxRl5XytyScYtFvORfAu02pmiGf3wLIhivl0I6t6c9LXlsT3cz7OlR uqbH/HBwGOT1wNNih/vifCd46qXaAirfU9PnRAW5AKt/qNpCr7tX06iuhkKvtR2F77M1xY JwTfxaQQFAk79Jsr/EaWP85Wcmy4g6thfMgD2yAQxWDx+9BE9aBS8HTaSU5jhnL9BBgb45 J6pNYmNKZNCbgG810rOYHtV3xSH6zkhum3SjF66v/8o947148TZDCuyBIFzOC+kyxrKan8 mODE7vzS1LoFn6dMXLqFNWSzJ4y8SknIKf4AjmyPqU2Dl+nqoIDXEFYzQBsnHg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=cwHU+8Gp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=cwHU+8Gp; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D64A3F65F X-Spam-Score: 4.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: Xn/nGsEAI2ny Hi, Attila Lendvai writes: > * gnu/home/services/ssh.scm (serialize-address-family): Use the public AP= I of > the maybe infrastructure. > * gnu/services/file-sharing.scm (serialize-maybe-string): Use maybe-value. > (serialize-maybe-file-object): Use maybe-value-set?. > * gnu/services/getmail.scm (getmail-retriever-configuration): Don't use > internals in unset field declarations. > (getmail-destination-configuration): Ditto. > * gnu/services/messaging.scm (raw-content?): Use maybe-value-set?. > (prosody-configuration): Use %unset-value. > * gnu/services/telephony.scm (jami-shepherd-services): Use maybe-value-se= t?. > (archive-name->username): Use maybe-value-set?. > * tests/services/configuration.scm ("maybe type, no default"): Use > %unset-value. [...] > --- a/gnu/services/telephony.scm > +++ b/gnu/services/telephony.scm > @@ -307,7 +307,7 @@ (define (jami-shepherd-services config) > (dbus (jami-configuration-dbus config)) > (dbus-daemon (file-append dbus "/bin/dbus-daemon")) > (accounts (jami-configuration-accounts config)) > - (declarative-mode? (not (eq? 'unset accounts)))) > + (declarative-mode? (maybe-value-set? accounts))) >=20=20 > (with-extensions (list guile-packrat ;used by guile-ac-d-bus > guile-ac-d-bus > @@ -649,7 +649,7 @@ (define (archive-name->username archive) > account-details) > (let ((username (archive-name->username > archive))) > - (when (not (eq? 'unset allowed-contacts)) > + (when (maybe-value-set? allowed-contacts) > ;; Reject calls from unknown contacts. > (set-account-details > '(("DHT.PublicInCalls" . "false")) usern= ame) > @@ -659,7 +659,7 @@ (define (archive-name->username archive) > ;; Add allowed ones. > (for-each (cut add-contact <> username) > allowed-contacts)) > - (when (not (eq? 'unset moderators)) > + (when (maybe-value-set? moderators) > ;; Disable the 'AllModerators' property. > (set-all-moderators #f username) > ;; Remove all moderators. maybe-value-set? cannot be used there, as the code runs on the target, not on the host, where (gnu services configuration) is not (and cannot) be in scope. I've made the simple change below and pushed: --8<---------------cut here---------------start------------->8--- modified gnu/services/telephony.scm @@ -649,7 +649,7 @@ (define (archive-name->username archive) account-details) (let ((username (archive-name->username archive))) - (when (maybe-value-set? allowed-contacts) + (when (not (eq? '#$%unset-value allowed-conta= cts)) ;; Reject calls from unknown contacts. (set-account-details '(("DHT.PublicInCalls" . "false")) usernam= e) @@ -659,7 +659,7 @@ (define (archive-name->username archive) ;; Add allowed ones. (for-each (cut add-contact <> username) allowed-contacts)) - (when (maybe-value-set? moderators) + (when (not (eq? '#$%unset-value moderators)) ;; Disable the 'AllModerators' property. (set-all-moderators #f username) ;; Remove all moderators. --8<---------------cut here---------------end--------------->8--- I've also adjusted a few 'unset mentions in the doc: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -19846,7 +19846,7 @@ 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 explicitly setting this field to the -@code{'unset} value. +@code{%unset-value} value. =20 @item @code{port} (default: @code{4222}) (type: maybe-number) The UDP port to bind to. When left unspecified, an available port is @@ -31362,7 +31362,7 @@ 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 -left unset, or is explicitly set to the @code{'unset} value. +left unset, or is explicitly set to the @code{%unset-value} value. =20 @c The following documentation was initially generated by @c (generate-tlp-documentation) in (gnu services pm). Manually maintained @@ -38983,8 +38983,7 @@ macro which is a shorthand of this. Sometimes a field should not be serialized if the user doesn=E2=80=99t spe= cify 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 left unset, or -is set to the @code{'unset} value, then it will not be -serialized. +is set to the @code{%unset-value} value, then it will not be serialized. =20 When defining a ``maybe type'', the corresponding serializer for the regular type will be used by default. For example, a field of type --8<---------------cut here---------------end--------------->8--- I've made these changes and pushed, as mentioned in a previous email. Thank you! Maxim