diff options
author | 45mg <[email protected]> | 2025-02-12 15:39:22 +0530 |
---|---|---|
committer | Maxim Cournoyer <[email protected]> | 2025-02-13 01:02:03 +0900 |
commit | 0caba8f5db48c15a2c3edae37e816654246fa986 (patch) | |
tree | 67798ceda58af8bc03c4ebeb2d1dbe167c881ea6 /gnu/services | |
parent | 51720d1afa68a54df92dd331c100b4995cb4070e (diff) |
services: network-manager: Add extra-configuration-files field.
Allow users to specify additional configuration files for NetworkManager.
These files will be added to /etc/NetworkManager/conf.d (NetworkManager's
default configuration directory location).
* gnu/services/networking.scm (<network-manager-configuration>)
[extra-configuration-files]: New field.
(network-manager-activation): Honor the new field.
* doc/guix.texi (Networking Setup): Document the new field.
Change-Id: I07479958e4d0aa318328c666a9630b779230b300
Modified-by: Maxim Cournoyer <[email protected]>
Signed-off-by: Maxim Cournoyer <[email protected]>
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/networking.scm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index af28bd0626..b9a5bef5d8 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -23,6 +23,7 @@ ;;; Copyright © 2023 Bruno Victal <[email protected]> ;;; Copyright © 2023 muradm <[email protected]> ;;; Copyright © 2024 Nigko Yerden <[email protected]> +;;; Copyright © 2025 45mg <[email protected]> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1253,18 +1254,27 @@ project's documentation} for more information." (default '())) (iwd? network-manager-configuration-iwd? ; TODO: deprecated field, remove. (default #f) - (sanitize warn-iwd?-field-deprecation))) + (sanitize warn-iwd?-field-deprecation)) + (extra-configuration-files + network-manager-configuration-extra-configuration-files + (default '()))) ;'((file-name-string file-like-object) ...) (define (network-manager-activation config) ;; Activation gexp for NetworkManager (match-record config <network-manager-configuration> - (network-manager dns vpn-plugins) + (network-manager dns vpn-plugins extra-configuration-files) #~(begin (use-modules (guix build utils)) (mkdir-p "/etc/NetworkManager/system-connections") #$@(if (equal? dns "dnsmasq") ;; create directory to store dnsmasq lease file '((mkdir-p "/var/lib/misc")) + '()) + #$@(if (pair? extra-configuration-files) ;if non-empty + `((symlink + ,(file-union "network-manager-configuration-directory" + extra-configuration-files) + "/etc/NetworkManager/conf.d")) '())))) (define (vpn-plugin-directory plugins) |