[PATCH] services: bluetooth: Add 'extra-config' field.

  • Open
  • quality assurance status badge
Details
2 participants
  • Brice Waegeneire
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Brice Waegeneire
Severity
normal
B
B
Brice Waegeneire wrote on 3 Jul 2021 22:50
(address . guix-patches@gnu.org)
20210703205015.13862-1-brice@waegenei.re
* gnu/services/desktop.scm (bluetooth-configuration): Add 'extra-config'
field.
(bluetooth-configuration-file): Use it.
---
gnu/services/desktop.scm | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

Toggle diff (30 lines)
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index cd800fcc2b..7109d5d476 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -400,14 +400,18 @@ site} for more information."
bluetooth-configuration make-bluetooth-configuration
bluetooth-configuration?
(bluez bluetooth-configuration-bluez (default bluez))
- (auto-enable? bluetooth-configuration-auto-enable? (default #f)))
+ (auto-enable? bluetooth-configuration-auto-enable? (default #f))
+ (extra-config bluetooth-configuration-extra-config ;list of strings
+ (default '())))
(define (bluetooth-configuration-file config)
"Return a configuration file for the systemd bluetooth service, as a string."
- (string-append
- "[Policy]\n"
- "AutoEnable=" (bool (bluetooth-configuration-auto-enable?
- config))))
+ (string-concatenate
+ (cons*
+ "[Policy]\n"
+ "AutoEnable=" (bool (bluetooth-configuration-auto-enable?
+ config)) "\n"
+ (bluetooth-configuration-extra-config config))))
(define (bluetooth-directory config)
(computed-file "etc-bluetooth"
--
2.31.1
M
M
Mathieu Othacehe wrote on 7 Jul 2021 16:35
(name . Brice Waegeneire)(address . brice@waegenei.re)(address . 49366@debbugs.gnu.org)
87k0m242g8.fsf@gnu.org
Hello Brice,

Toggle quote (4 lines)
> * gnu/services/desktop.scm (bluetooth-configuration): Add 'extra-config'
> field.
> (bluetooth-configuration-file): Use it.

I guess you have a specific use case in mind, adding a short
documentation about the <bluetooth-configuration> and the new
extra-config field could be nice here.

Otherwise it seems fine to me.

Thanks,

Mathieu
?