diff options
| author | Angus Gibson <angus@agibson.me> | 2026-05-14 13:55:38 +1000 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-05-31 08:30:05 +0200 |
| commit | cf95f60011a7407c2089ef6807823a7b287419c2 (patch) | |
| tree | 0d04205fb84b0e343783aa1b589b8dfca875daa5 /gnu | |
| parent | 5cee86d9c7b0eafa90baae5d596326e520f31bb7 (diff) | |
services: network-manager: Allow dnsmasq configuration.
When using (dns "dnsmasq"), configuration is achieved through the
/etc/NetworkManager/dnsmasq.d directory. The new field parallels
extra-configuration-files for configuration of NetworkManager itself.
* gnu/services/networking.scm (network-manager-configuration)
<dnsmasq-configuration-files>: New field.
* doc/guix.texi (Networking Setup): Document it.
Change-Id: I31d772939e4e1d65f3ff407d70a87a64a047aac6
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/services/networking.scm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 1e85ed97e58..c8a7ce21c95 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm | |||
| @@ -1468,12 +1468,15 @@ project's documentation} for more information." | |||
| 1468 | (sanitize warn-iwd?-field-deprecation)) | 1468 | (sanitize warn-iwd?-field-deprecation)) |
| 1469 | (extra-configuration-files | 1469 | (extra-configuration-files |
| 1470 | network-manager-configuration-extra-configuration-files | 1470 | network-manager-configuration-extra-configuration-files |
| 1471 | (default '()))) ;'((file-name-string file-like-object) ...) | 1471 | (default '())) ;'((file-name-string file-like-object) ...) |
| 1472 | (dnsmasq-configuration-files | ||
| 1473 | network-manager-configuration-dnsmasq-configuration-files | ||
| 1474 | (default '()))) | ||
| 1472 | 1475 | ||
| 1473 | (define (network-manager-activation config) | 1476 | (define (network-manager-activation config) |
| 1474 | ;; Activation gexp for NetworkManager | 1477 | ;; Activation gexp for NetworkManager |
| 1475 | (match-record config <network-manager-configuration> | 1478 | (match-record config <network-manager-configuration> |
| 1476 | (network-manager dns vpn-plugins extra-configuration-files) | 1479 | (network-manager dns vpn-plugins extra-configuration-files dnsmasq-configuration-files) |
| 1477 | #~(begin | 1480 | #~(begin |
| 1478 | (use-modules (guix build utils)) | 1481 | (use-modules (guix build utils)) |
| 1479 | (mkdir-p "/etc/NetworkManager/system-connections") | 1482 | (mkdir-p "/etc/NetworkManager/system-connections") |
| @@ -1481,6 +1484,19 @@ project's documentation} for more information." | |||
| 1481 | ;; create directory to store dnsmasq lease file | 1484 | ;; create directory to store dnsmasq lease file |
| 1482 | '((mkdir-p "/var/lib/misc")) | 1485 | '((mkdir-p "/var/lib/misc")) |
| 1483 | '()) | 1486 | '()) |
| 1487 | #$@(if (pair? dnsmasq-configuration-files) ;if non-empty | ||
| 1488 | ;; If /etc/NetworkManager/dnsmasq.d is a symlink to a store file, | ||
| 1489 | ;; delete it. | ||
| 1490 | `((if (and (file-exists? "/etc/NetworkManager/dnsmasq.d") | ||
| 1491 | (store-file-name? | ||
| 1492 | (canonicalize-path "/etc/NetworkManager/dnsmasq.d"))) | ||
| 1493 | (delete-file-recursively | ||
| 1494 | "/etc/NetworkManager/dnsmasq.d")) | ||
| 1495 | (symlink | ||
| 1496 | ,(file-union "network-manager-dnsmasq-configuration-directory" | ||
| 1497 | dnsmasq-configuration-files) | ||
| 1498 | "/etc/NetworkManager/dnsmasq.d")) | ||
| 1499 | '()) | ||
| 1484 | #$@(if (pair? extra-configuration-files) ;if non-empty | 1500 | #$@(if (pair? extra-configuration-files) ;if non-empty |
| 1485 | ;; If /etc/NetworkManager/conf.d is a symlink to a store file, | 1501 | ;; If /etc/NetworkManager/conf.d is a symlink to a store file, |
| 1486 | ;; delete it. | 1502 | ;; delete it. |
