[PATCH] gnu: services: dns: Escape hatch for dnsmasq-configuration.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Sergey Trofimov
Owner
unassigned
Submitted by
Sergey Trofimov
Severity
normal
S
S
Sergey Trofimov wrote on 1 May 22:43 +0200
(address . guix-patches@gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
a9f54f160d152dc3f7a5e63f339bcc3b6de79831.1714595772.git.sarg@sarg.org.ru
* gnu/service/dns.scm: (<dnsmasq-configuration>)[extra-options]: Add.
* doc/guix.texi: Document (<dnsmasq-configuration>)[extra-options].
---
doc/guix.texi | 4 ++++
gnu/services/dns.scm | 7 +++++--
2 files changed, 9 insertions(+), 2 deletions(-)

Toggle diff (49 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 749d689ac1..17798becd5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33498,6 +33498,10 @@ DNS Services
resolving MAC addresses is only possible if the client is in the local
network or obtained a DHCP lease from dnsmasq.
+@item @code{extra-options} (default: @code{'()})
+This option provides an ``escape hatch'' for the user to provide arbitrary
+command-line arguments to @command{dnsmasq} as a list of strings.
+
@end table
@end deftp
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index 6608046909..043c34599c 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -739,6 +739,8 @@ (define-record-type* <dnsmasq-configuration>
(default #t)) ;boolean
(listen-addresses dnsmasq-configuration-listen-address
(default '())) ;list of string
+ (extra-options dnsmasq-configuration-extra-options
+ (default '())) ;list of string
(resolv-file dnsmasq-configuration-resolv-file
(default "/etc/resolv.conf")) ;string
(no-resolv? dnsmasq-configuration-no-resolv?
@@ -798,7 +800,7 @@ (define (dnsmasq-shepherd-service config)
tftp-single-port? tftp-secure?
tftp-max tftp-mtu tftp-no-blocksize?
tftp-lowercase? tftp-port-range
- tftp-root tftp-unique-root)
+ tftp-root tftp-unique-root extra-options)
(shepherd-service
(provision '(dnsmasq))
(requirement '(networking))
@@ -877,7 +879,8 @@ (define (dnsmasq-shepherd-service config)
(if (> (length tftp-unique-root) 0)
(format #f "--tftp-unique-root=~a" tftp-unique-root)
(format #f "--tftp-unique-root")))
- '()))
+ '())
+ #$@extra-options)
#:pid-file "/run/dnsmasq.pid"))
(stop #~(make-kill-destructor)))))

base-commit: 5c13ab50b9c7d44238c64e5337027f04ae1d9223
--
2.41.0
L
L
Ludovic Courtès wrote on 13 Jun 22:43 +0200
(name . Sergey Trofimov)(address . sarg@sarg.org.ru)(address . 70706-done@debbugs.gnu.org)
8734pginep.fsf@gnu.org
Sergey Trofimov <sarg@sarg.org.ru> skribis:

Toggle quote (3 lines)
> * gnu/service/dns.scm: (<dnsmasq-configuration>)[extra-options]: Add.
> * doc/guix.texi: Document (<dnsmasq-configuration>)[extra-options].

Applied, thanks!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 70706@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70706
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch