Subject: [bug#49366] [PATCH] services: bluetooth: Add 'extra-config' field.

From: Brice Waegeneire <[email-masked]>
Date: Sat, 3 Jul 2021 22:50:15 +0200

* 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(-)

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