[PATCH 1/6] services: Add pulseaudio-configuration.

  • Done
  • quality assurance status badge
Details
2 participants
  • Leo Prikler
  • Marius Bakke
Owner
unassigned
Submitted by
Leo Prikler
Severity
normal
Merged with

Debbugs page

Leo Prikler wrote 5 years ago
(address . guix-patches@gnu.org)(address . 39053@debbugs.gnu.org)
20200110014823.10595-1-leo.prikler@student.tugraz.at
* gnu/services/sound (<pulseaudio-configuration>): New record.
(pulseaudio-etc): New procedure.
(pulseaudio-service-type): Update accordingly.
---
gnu/services/sound.scm | 43 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)

Toggle diff (74 lines)
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index aaca733729..307e62fd1b 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -34,6 +34,7 @@
#:export (alsa-configuration
alsa-service-type
+ pulseaudio-configuration
pulseaudio-service-type))
;;; Commentary:
@@ -106,19 +107,57 @@ ctl.!default {
;;; PulseAudio
;;;
+(define-record-type* <pulseaudio-configuration>
+ pulseaudio-configuration make-pulseaudio-configuration
+ pulseaudio-configuration?
+ (client-conf pulseaudio-client-conf
+ (default '()))
+ (daemon-conf pulseaudio-daemon-conf
+ (default '()))
+ (script-file pulseaudio-script-file
+ (default (file-append pulseaudio "/etc/pulse/default.pa")))
+ (system-script-file pulseaudio-system-script-file
+ (default
+ (file-append pulseaudio "/etc/pulse/system.pa"))))
+
(define (pulseaudio-environment config)
;; Define this variable in the global environment such that
;; pulseaudio swh-plugins works.
`(("LADSPA_PATH"
. ,(file-append swh-plugins "/lib/ladspa"))))
+(define (pulseaudio-conf-entry arg)
+ (match arg
+ ((key . value)
+ (format #f "~a = ~s~%" key value))
+ ((? string? _)
+ (string-append arg "\n"))))
+
+(define pulseaudio-etc
+ (match-lambda
+ (($ <pulseaudio-configuration> client-conf daemon-conf
+ default-script-file system-script-file)
+ `(("pulse"
+ ,(file-union
+ "pulse"
+ `(("client.conf"
+ ,(apply mixed-text-file "client.conf"
+ (map pulseaudio-conf-entry client-conf)))
+ ("daemon.conf"
+ ,(apply mixed-text-file "daemon.conf"
+ "default-script-file = " default-script-file "\n"
+ (map pulseaudio-conf-entry daemon-conf)))
+ ("default.pa" ,default-script-file)
+ ("system.pa" ,system-script-file))))))))
+
(define pulseaudio-service-type
(service-type
(name 'pulseaudio)
(extensions
(list (service-extension session-environment-service-type
- pulseaudio-environment)))
- (default-value #f)
+ pulseaudio-environment)
+ (service-extension etc-service-type pulseaudio-etc)))
+ (default-value (pulseaudio-configuration))
(description "Configure PulseAudio sound support.")))
;;; sound.scm ends here
--
2.24.1
Marius Bakke wrote 5 years ago
(address . control@debbugs.gnu.org)
87v9piyluy.fsf@devup.no
merge 39053 39052 39054 39055 39062 39061 39063 39065 39064
thanks
?
Your comment

This issue is archived.

To comment on this conversation send an email to 39062@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 39062
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help