diff options
| -rw-r--r-- | doc/guix.texi | 13 | ||||
| -rw-r--r-- | gnu/services/dns.scm | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index dbbb811a60b..2d5ec867eaf 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -19843,6 +19843,19 @@ The Knot package. | |||
| 19843 | @item @code{run-directory} (default: @code{"/var/run/knot"}) | 19843 | @item @code{run-directory} (default: @code{"/var/run/knot"}) |
| 19844 | The run directory. This directory will be used for pid file and sockets. | 19844 | The run directory. This directory will be used for pid file and sockets. |
| 19845 | 19845 | ||
| 19846 | @item @code{includes} (default: @code{'()}) | ||
| 19847 | A list of strings or file-like objects denoting other files that must be | ||
| 19848 | included at the top of the configuration file. | ||
| 19849 | |||
| 19850 | @cindex secrets, Knot service | ||
| 19851 | This can be used to manage secrets out-of-band. For example, secret | ||
| 19852 | keys may be stored in an out-of-band file not managed by Guix, and | ||
| 19853 | thus not visible in @file{/gnu/store}---e.g., you could store secret | ||
| 19854 | key configuration in @file{/etc/knot/secrets.conf} and add this file | ||
| 19855 | to the @code{includes} list. | ||
| 19856 | |||
| 19857 | It can also be used to add configuration not supported by this interface. | ||
| 19858 | |||
| 19846 | @item @code{listen-v4} (default: @code{"0.0.0.0"}) | 19859 | @item @code{listen-v4} (default: @code{"0.0.0.0"}) |
| 19847 | An ip address on which to listen. | 19860 | An ip address on which to listen. |
| 19848 | 19861 | ||
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 1ef754b3607..445e03570ab 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm | |||
| @@ -207,6 +207,8 @@ | |||
| 207 | (default knot)) | 207 | (default knot)) |
| 208 | (run-directory knot-configuration-run-directory | 208 | (run-directory knot-configuration-run-directory |
| 209 | (default "/var/run/knot")) | 209 | (default "/var/run/knot")) |
| 210 | (includes knot-configuration-includes | ||
| 211 | (default '())) | ||
| 210 | (listen-v4 knot-configuration-listen-v4 | 212 | (listen-v4 knot-configuration-listen-v4 |
| 211 | (default "0.0.0.0")) | 213 | (default "0.0.0.0")) |
| 212 | (listen-v6 knot-configuration-listen-v6 | 214 | (listen-v6 knot-configuration-listen-v6 |
| @@ -296,6 +298,8 @@ | |||
| 296 | (error-out "knot configuration field must be a package.")) | 298 | (error-out "knot configuration field must be a package.")) |
| 297 | (unless (string? (knot-configuration-run-directory config)) | 299 | (unless (string? (knot-configuration-run-directory config)) |
| 298 | (error-out "run-directory must be a string.")) | 300 | (error-out "run-directory must be a string.")) |
| 301 | (unless (list? (knot-configuration-includes config)) | ||
| 302 | (error-out "includes must be a list of strings or file-like objects.")) | ||
| 299 | (unless (list? (knot-configuration-keys config)) | 303 | (unless (list? (knot-configuration-keys config)) |
| 300 | (error-out "keys must be a list of knot-key-configuration.")) | 304 | (error-out "keys must be a list of knot-key-configuration.")) |
| 301 | (for-each (lambda (key) (verify-knot-key-configuration key)) | 305 | (for-each (lambda (key) (verify-knot-key-configuration key)) |
| @@ -529,6 +533,10 @@ | |||
| 529 | #~(begin | 533 | #~(begin |
| 530 | (call-with-output-file #$output | 534 | (call-with-output-file #$output |
| 531 | (lambda (port) | 535 | (lambda (port) |
| 536 | (if (knot-configuration-includes config) | ||
| 537 | (for-each (lambda (inc) | ||
| 538 | (format port "include: ~a\n" inc)) | ||
| 539 | (knot-configuration-includes config))) | ||
| 532 | (format port "server:\n") | 540 | (format port "server:\n") |
| 533 | (format port " rundir: ~a\n" #$(knot-configuration-run-directory config)) | 541 | (format port " rundir: ~a\n" #$(knot-configuration-run-directory config)) |
| 534 | (format port " user: knot\n") | 542 | (format port " user: knot\n") |
