[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/12: services: configuration: Document multiple configurations per fie
From: |
guix-commits |
Subject: |
04/12: services: configuration: Document multiple configurations per field. |
Date: |
Mon, 14 Oct 2024 08:12:50 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 766ad072ad90d4ffc161cb83e29910b7bb3a9d54
Author: Herman Rimm <herman@rimm.ee>
AuthorDate: Fri Sep 27 20:39:19 2024 +0200
services: configuration: Document multiple configurations per field.
* gnu/services/configuration.scm (generate-documentation): Filter for all
configurations associated with each field-name.
* doc/guix.texi (Complex Configurations): Describe use case for multiple
field-names.
Change-Id: I6d1e7b8858231aa05fda884b31a9bd0a48f07293
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
doc/guix.texi | 4 +++-
gnu/services/configuration.scm | 9 +++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 35e5883308..07dd00a7c2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -44702,7 +44702,9 @@ available for the configuration record.
@var{sub-documentation} is a @code{(@var{field-name}
@var{configuration-name})} tuple. @var{field-name} is the name of the
field which takes another configuration record as its value, and
-@var{configuration-name} is the name of that configuration record.
+@var{configuration-name} is the name of that configuration record. The
+same value may be used for multiple @var{field-name}s, in case a field
+accepts different types of configurations.
@var{sub-documentation} is only needed if there are nested configuration
records. For example, the @code{getmail-configuration} record
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index d2b1687496..e76ad5e8cb 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -460,8 +461,12 @@ DEFAULT."
(para ,@field-docs)
,@(append-map
generate
- (or (assq-ref sub-documentation field-name)
- '())))))
+ (filter-map
+ (match-lambda
+ ((name config)
+ (and (eq? name field-name)
+ config)))
+ sub-documentation)))))
fields)))))))
(stexi->texi `(*fragment* . ,(generate documentation-name))))
- branch master updated (221a922746 -> 6757bfdfc0), guix-commits, 2024/10/14
- 03/12: doc: Document home-shepherd-configuration-daemonize?, guix-commits, 2024/10/14
- 04/12: services: configuration: Document multiple configurations per field.,
guix-commits <=
- 05/12: image: Use file system options in make-vfat-image., guix-commits, 2024/10/14
- 06/12: image: Add support for btrfs., guix-commits, 2024/10/14
- 08/12: gnu: git-annex-remote-rclone: Upgrade to v0.8, guix-commits, 2024/10/14
- 10/12: gnu: nvc: Update to 1.14.0., guix-commits, 2024/10/14
- 11/12: home: services: unclutter: Inherit $DISPLAY., guix-commits, 2024/10/14
- 01/12: doc: Refer to ‘iso-codes’, not ‘iso-codes/pinned’., guix-commits, 2024/10/14
- 02/12: home: home-shepherd-configuration: Add silent? field., guix-commits, 2024/10/14
- 09/12: gnu: xen: Update to 4.19.0. [security fixes], guix-commits, 2024/10/14
- 07/12: services: tor: Add support for pluggable transports., guix-commits, 2024/10/14
- 12/12: doc: Define the purpose, membership, and creation of teams., guix-commits, 2024/10/14