GNU bug report logs - #53676
[PATCH 0/5] *** PulseAudio service improvements ***

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Tue, 1 Feb 2022 04:15:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #133 received at 53676 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 53676 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH v2 4/4] services: pulseaudio: Deploy the configuration files
 to /etc/pulse.
Date: Thu, 24 Feb 2022 11:38:28 -0500
* gnu/services/sound.scm (pulseaudio-environment)
[PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic to...
(pulseaudio-etc): ... this service extension.  Guard against producing empty
files.
---
 gnu/services/sound.scm | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index eecea1a733..336f6c39a0 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -144,11 +144,11 @@ (define (pulseaudio-conf-entry arg)
 (define pulseaudio-environment
   (match-lambda
     (($ <pulseaudio-configuration> client-conf daemon-conf default-script-file)
-     `(("PULSE_CONFIG" . ,(apply mixed-text-file "daemon.conf"
-                                 "default-script-file = " default-script-file "\n"
-                                 (map pulseaudio-conf-entry daemon-conf)))
-       ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf"
-                                       (map pulseaudio-conf-entry client-conf)))))))
+     ;; These config files kept at a fixed location, so that the following
+     ;; environment values are stable and do not require the user to reboot to
+     ;; effect their PulseAudio configuration changes.
+     '(("PULSE_CONFIG" . "/etc/pulse/daemon.conf")
+       ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf")))))
 
 (define (extra-script-files->file-union extra-script-files)
   "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION."
@@ -176,8 +176,8 @@ (define (assert-pulseaudio-script-file-name name)
 
 (define pulseaudio-etc
   (match-lambda
-    (($ <pulseaudio-configuration> _ _ default-script-file extra-script-files
-                                   system-script-file)
+    (($ <pulseaudio-configuration> client-conf daemon-conf default-script-file
+                                   extra-script-files system-script-file)
      `(("pulse"
         ,(file-union
           "pulse"
@@ -186,7 +186,18 @@ (define pulseaudio-etc
             ,@(if (null? extra-script-files)
                   '()
                   `(("default.pa.d" ,(extra-script-files->file-union
-                                      extra-script-files)))))))))))
+                                      extra-script-files))))
+            ,@(if (null? daemon-conf)
+                  '()
+                  `(("daemon.conf"
+                     ,(apply mixed-text-file "daemon.conf"
+                             "default-script-file = " default-script-file "\n"
+                             (map pulseaudio-conf-entry daemon-conf)))))
+            ,@(if (null? client-conf)
+                  '()
+                  `(("client.conf"
+                     ,(apply mixed-text-file "client.conf"
+                             (map pulseaudio-conf-entry client-conf))))))))))))
 
 (define pulseaudio-service-type
   (service-type
-- 
2.34.0





This bug report was last modified 3 years and 144 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.