From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id SDFKLai33WWxMgEAqHPOHw:P1 (envelope-from ) for ; Tue, 27 Feb 2024 11:21:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id SDFKLai33WWxMgEAqHPOHw (envelope-from ) for ; Tue, 27 Feb 2024 11:21:28 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=NHviorbS; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709029288; 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=QUmG8fBcK6BapkPkESbMG8VA09Rm4GB7JmoI/tztwcE=; b=J4uw7DUhlaBi9k4rvSpuJBEBYnmTTjumfbC1EmVVhKA1B15ZX5XtBT4v5xx39Uy4h7PF8y KhU3ILu+AEzmYrXu1sKJMQVJvdEcPaDNAaSq0IMdniE10C6Px4CsXK+XYpSiMo4vdOlqlm r2q7qVQ6+9XPyvM7mUvK7pGSCWBHK2Fa8QPmZs8ZEJqgL1xB0KNsMBcZLqK7RB9xlanLx2 o1tKRf27ykcAzzED5ybyMfPQ+xzo7bAu61kBG5oj4m9VNSDGdnvh6f8EfAztNHfSLP7yql zNGpZH9ReLuAayQJKwXwFGNhicsNpja+UOENoOV8Dick0h8jv6LEw0opmgip6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=NHviorbS; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709029288; a=rsa-sha256; cv=none; b=P5fmA+zB/Kawu6Hg+pGG8JXZ2e5RDKi+1z7hHzBbrcjwzqVmN2vpA7fxUzE45WK/hSXE4i 5C0a3YW142d7OGmH20x9vT2JXkkiaoygP9FECFyGgUcGzRykoYLCL+zHJhtSxh2/aMwcg9 rlNZGdYlyL1+FLOK6nW6iOehB+r/Hty4D6nKu3W4k9sERwg9RrnqwqxKaOdeSbJvTIaK44 STwKGvmmGc0DGsRHjJ8FDturt9oCrK+60mgEi0f1Jl9LFeICPgPY8rMzcnkOGHQU6CKgZo XVQVhJP9Ctm9+B9NwhC61c99+AdD4zhVVNQ51U7p/4nzbNTb2tSjiytRdbocyQ== 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 781F2C3C5 for ; Tue, 27 Feb 2024 11:21:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reuZl-0008TT-GD; Tue, 27 Feb 2024 05:20:41 -0500 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 1reuZg-0008Jz-Qp for guix-patches@gnu.org; Tue, 27 Feb 2024 05:20:37 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reuZg-0003la-Ii for guix-patches@gnu.org; Tue, 27 Feb 2024 05:20:36 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reua6-0008HT-Cf for guix-patches@gnu.org; Tue, 27 Feb 2024 05:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68757] [PATCH] services: dns: Add unbound service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 27 Feb 2024 10:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68757 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: =?UTF-8?Q?S=C3=B6ren?= Tempel Cc: 68757@debbugs.gnu.org Received: via spool by 68757-submit@debbugs.gnu.org id=B68757.170902922331679 (code B ref 68757); Tue, 27 Feb 2024 10:21:02 +0000 Received: (at 68757) by debbugs.gnu.org; 27 Feb 2024 10:20:23 +0000 Received: from localhost ([127.0.0.1]:40869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reuZS-0008Eo-Ma for submit@debbugs.gnu.org; Tue, 27 Feb 2024 05:20:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reuZP-0008E3-PW for 68757@debbugs.gnu.org; Tue, 27 Feb 2024 05:20:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reuUB-000216-07; Tue, 27 Feb 2024 05:14:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=QUmG8fBcK6BapkPkESbMG8VA09Rm4GB7JmoI/tztwcE=; b=NHviorbSYSPxfGDVksf0 mfGlBcXehZWsQbgsabobvm+QQj+R0rQ8MmpfoSE1fLZmqbf56Y/2Vu4aTuQ5RmRRCNT/iwK5BI7Z9 zxThStBcAJLFUyqdxni9fgEdcbKAUWl3cd+EBhDqKFdZdtLHFbr7gjDhN0p2L9rb7pOFa4c52l/OM a1190XsoUDknYwJLGb9PbjRtoifMOO60VcuWA1seCc5ahkXsMgjYL5xZt8RHCAn+O8Nr++0pH+sme a0yHFYLRU5oSz5NyswvP7WyFXqbTSiF+cJI/854t35yiTYyPSXloBG5PeuLzzTFmQDMmEVJFLVm8G azBV8ATIRGHeBw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <2O0HFY6AW6QUG.320OU5YPLJHHZ@8pit.net> ("=?UTF-8?Q?S=C3=B6ren?= Tempel"'s message of "Sat, 24 Feb 2024 19:45:44 +0100") References: <20240127121040.7156-2-soeren@soeren-tempel.net> <87sf1pls1y.fsf@gnu.org> <2O0HFY6AW6QUG.320OU5YPLJHHZ@8pit.net> Date: Tue, 27 Feb 2024 11:14:51 +0100 Message-ID: <87frxei57o.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -5.31 X-Spam-Score: -5.31 X-Migadu-Queue-Id: 781F2C3C5 X-TUID: 4sAag84ODkJ7 Hi, S=C3=B6ren Tempel skribis: > Prior to submitting this patch I was experimenting with both records and > alists for the Unbound configuration abstraction. Unbound has **a lot** > of configuration options and new options are constantly getting added by > upstream, see unbound.conf(5). Therefore, supporting them through a > record type with fields for each configuration option requires a lot of > code. Furthermore, it will require constant maintenance to keep up with > new upstream options. Right. > I looked at prior art and noticed that the Nix service configuration for > unbound just uses a plain hash with string keys [1]. This seemed like a > good way to deal with the complexity of unbound.conf, hence I opted for > a similar approach here. I don't think it's feasible to model the > configuration using a record type with several hundred fields and, as rde > uses an alist-based approach for services with similar complexity, I > don't think its unheard of in the Guix world either. While it is not as > =E2=80=9Ctype safe=E2=80=9D as a record-based approach (e.g. you can crea= te semantically > invalid unbound configurations), it offers good forwards compatibility > and requires less Scheme code. > > In theory, it would be possible to model sections with less options > (e.g. the =E2=80=98remote-control=E2=80=99 or =E2=80=98server=E2=80=99 op= tion) using records. However, > using alists for some sections and records for others seems inconsistent > to me. > > Please let me know what you think so I can revise this accordingly. The usual approach for services in Guix is to have a record for the most common options (or for all the options if that doing so can be automated, as was done with Dovecot) and an =E2=80=9Cescape hatch=E2=80=9D = that lets users insert raw config text. Key/value alists are not a common idiom. I would suggest sticking to this model as much as possible. Perhaps key/value alists would be preferable as an escape hatch than raw strings? Now, I don=E2=80=99t use Unbound, so I can only give general advice based on what=E2=80=99s usually done in Guix. Maybe =E2=80=98knot-service-type=E2= =80=99 is a useful source of inspiration. HTH! Ludo=E2=80=99.