[bug#75140] services: dnsmasq: Allow custom Shepherd provision
Commit Message
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
---
doc/guix.texi | 4 ++++
gnu/services/dns.scm | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
base-commit: 831b94a1efcea8f793afc949b5123a6235c9bb1a
Comments
45mg <45mg.writes@gmail.com> writes:
> 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
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
@@ -34129,6 +34129,10 @@ DNS Services
@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.
@@ -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