services: dnsmasq: Allow custom Shepherd provision

Allow users to have multiple dnsmasq instances by specifying different
`provision` values for the corresponding Shepherd services, similar to
what is done with `static-networking-service-type`.

* gnu/services/dns.scm (<dnsmasq-configuration>)[provision]: new option.
(dnsmasq-shepherd-service): Use supplied provision value.
* doc/guix.texi (DNS Services)[dnsmasq-configuration]: Document it.

Change-Id: I78c7f015cb1db239a600bc5373b2fd80e8b9b9f4
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
45mg 2024-12-27 08:29:52 -05:00 committed by Ludovic Courtès
parent f8513cef62
commit 66df3296c4
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 7 additions and 1 deletions

View file

@ -34169,6 +34169,10 @@ Data type representing the configuration of dnsmasq.
@item @code{package} (default: @var{dnsmasq})
Package object of the dnsmasq server.
@item @code{provision} (default: @code{'(dnsmasq)})
A list of symbols for the Shepherd service corresponding to this dnsmasq
configuration.
@item @code{no-hosts?} (default: @code{#f})
When true, don't read the hostnames in /etc/hosts.

View file

@ -731,6 +731,8 @@ (define-record-type* <dnsmasq-configuration>
dnsmasq-configuration?
(package dnsmasq-configuration-package
(default dnsmasq)) ;file-like
(provision dnsmasq-provision
(default '(dnsmasq)))
(no-hosts? dnsmasq-configuration-no-hosts?
(default #f)) ;boolean
(port dnsmasq-configuration-port
@ -802,7 +804,7 @@ (define (dnsmasq-shepherd-service config)
tftp-lowercase? tftp-port-range
tftp-root tftp-unique-root extra-options)
(shepherd-service
(provision '(dnsmasq))
(provision (dnsmasq-provision config))
(requirement '(networking))
(documentation "Run the dnsmasq DNS server.")
(start #~(make-forkexec-constructor