From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kNEtNFOXg2SvAwEASxT56A (envelope-from ) for ; Fri, 09 Jun 2023 23:19:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gHhlM1OXg2T8ewAAG6o9tA (envelope-from ) for ; Fri, 09 Jun 2023 23:19:15 +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 43AC1E0DE for ; Fri, 9 Jun 2023 23:19:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7jVg-0005DS-Lr; Fri, 09 Jun 2023 17:19:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7jVf-0005DH-2T for guix-patches@gnu.org; Fri, 09 Jun 2023 17:19:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7jVe-0006jI-Ps; Fri, 09 Jun 2023 17:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q7jVe-0000Pr-JF; Fri, 09 Jun 2023 17:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, liliana.prikler@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 09 Jun 2023 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63985 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63985@debbugs.gnu.org Cc: Bruno Victal , ludo@gnu.org, maxim.cournoyer@gmail.com, liliana.prikler@gmail.com X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org, maxim.cournoyer@gmail.com, liliana.prikler@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.16863455291578 (code B ref -1); Fri, 09 Jun 2023 21:19:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jun 2023 21:18:49 +0000 Received: from localhost ([127.0.0.1]:32868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7jVQ-0000PO-TS for submit@debbugs.gnu.org; Fri, 09 Jun 2023 17:18:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:54216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7jVP-0000PF-As for submit@debbugs.gnu.org; Fri, 09 Jun 2023 17:18:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7jVO-0005CP-Uo for guix-patches@gnu.org; Fri, 09 Jun 2023 17:18:46 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7jVN-0006gA-5S for guix-patches@gnu.org; Fri, 09 Jun 2023 17:18:46 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id 8D6CD20D86 for ; Fri, 9 Jun 2023 23:18:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id C8E8B80097; Fri, 9 Jun 2023 23:18:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MqEhTByOxNlt; Fri, 9 Jun 2023 23:18:38 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 39E4B80060; Fri, 9 Jun 2023 23:18:38 +0200 (CEST) From: Bruno Victal Date: Fri, 9 Jun 2023 22:18:24 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=185.26.105.235; envelope-from=mirai@makinata.eu; helo=smtpm4.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1686345555; a=rsa-sha256; cv=none; b=fUEVcN5NVCVxG1qwFAnlEu/8+NHAOnEDKAXUtA9W1qV+gOEWOYfQ+qivSYvb8qT0BRjHyQ ESnvTywEuD0Mqt75M7SrdHTT/REiqgiouO5RA1na2ORxHO58+lu7wiJ6idMvD7AFkBoRgH lWahv6tXDXfsUwl2dNm/dGjRdkQac7tXqJZq9+DzQLjvhokYldfQOhQHkQmQhG3gQGWSCf FRGBzUqYtfs1146Fmgig9Yf6rkKhsyb3SLgI+2TCYw+u8N/HIZeg2WpaAigHx+SsNf5weC IS6WhT25WBUXWLL+Aoj5IatRqkAv8H+owyY5+gYy2Cck+w8ivsFy2SMUAZdpDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1686345555; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0S+k3v3w7OF8EbYbSs5NahpeTgcC2F5mqsWUwNlK/fo=; b=CXfiVyrAS8VAR3TFukbPtqLRBL46mLYdvtmQFaUn+fwzabSRIKBaygk+dgRNWQZvQ0c1TM rd/HfwOGx35QW5MSpXNOWOV4M+pjTMHFsg5pab35lDoWA9l5PjO4ez+giDTH+HdsAWrjyp XRAx2bqVHfqhAWfIs1iBirLuBFOhH6oUjI/BMDAyVsTVcBZPM/fJhiBmLAxP+ClJol7xne nrMS1ixHIyw8SLdddaB1CHm96LCaiyrBq7NwRukH0ozcYgs09BuKwIZ3Fim7GV9KAKnZne fCJcGWxESYxtvJvn9qyQ7AjtN96YgVyo7Ca0Wzop1XQulkrTuAzEsm+YhIgyuQ== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.41 X-Spam-Score: -1.41 X-Migadu-Queue-Id: 43AC1E0DE X-TUID: fqIx1sAw0e3r This RFC patch series (more like 3 patch series for the price of 1) implements the following: * Serializer Keyword arguments parameter in define-configuration. Allows for serializing procedures to be specified as: (define* (serialize-string field-name value #:key …) …) Examples in the unit tests. * Express serialize-configuration with SRFI-171 transducers. The ‘base-transducer’ can be used to craft more specialized configuration record serializers. * Generic INI serializer. This procedure can be used for crafting INI files from a record-type defined with define-configuration. Example for generic-ini in action can be found in the unit test. These changes are motivated in part by a (in progress) refactoring of the NetworkManager service-type. Notes: * I've left Generic-INI and serializer-kwargs undocumented since this is at its RFC stage. * The (gnu services configuration generic-ini) module contains some trailing notes that should be removed before merging in. * jami-account->alist explicitly checks for the empty-string. (which I consider to be a serialization “artifact” arising from define-maybe) This is the only (relevant) test that failed and will need to be investigated. Bruno Victal (5): services: configuration: Simplify normalize-extra-args. services: configuration: Use transducers within serialize-configuration. services: fstrim-service-type: Serialize with SRFI-171 transducers. services: configuration: Add serializer-kwargs field. services: configuration: New generic-ini module. Makefile.am | 1 + gnu/local.mk | 1 + gnu/services/configuration.scm | 86 +++++++++---- gnu/services/configuration/generic-ini.scm | 129 +++++++++++++++++++ gnu/services/linux.scm | 11 +- tests/services/configuration.scm | 38 +++++- tests/services/configuration/generic-ini.scm | 106 +++++++++++++++ 7 files changed, 333 insertions(+), 39 deletions(-) create mode 100644 gnu/services/configuration/generic-ini.scm create mode 100644 tests/services/configuration/generic-ini.scm base-commit: c348b1be3891e6eb47bbdd9fc1587aba2b6ab0b7 -- 2.39.2