From: Leo Prikler <leo.prikler@student.tugraz.at>
To: 39062@debbugs.gnu.org
Cc: 39053@debbugs.gnu.org
Subject: [bug#39062] [PATCH 1/6] services: Add pulseaudio-configuration.
Date: Fri, 10 Jan 2020 02:48:19 +0100 [thread overview]
Message-ID: <20200110014823.10595-1-leo.prikler@student.tugraz.at> (raw)
In-Reply-To: <87blrc1epy.fsf@devup.no>
* 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(-)
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
next prev parent reply other threads:[~2020-01-10 1:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-09 13:57 [bug#39053] [PATCH] Add pulseaudio configuration and fix volume bugs Leo Prikler
2020-01-09 13:57 ` [bug#39052] [PATCH 1/3] services: Add pulseaudio-configuration Leo Prikler
2020-01-09 13:57 ` [bug#39054] [PATCH 2/3] services: pulseaudio-service-type: Honor /etc Leo Prikler
2020-01-09 13:57 ` [bug#39055] [PATCH 3/3] services: Add pulseaudio to %desktop-services Leo Prikler
2020-01-09 21:50 ` [bug#39053] [PATCH] Add pulseaudio configuration and fix volume bugs Marius Bakke
2020-01-10 1:48 ` Leo Prikler [this message]
2020-01-10 1:48 ` [bug#39061] [PATCH 2/6] services: pulseaudio-service-type: Honor /etc Leo Prikler
2020-01-11 16:57 ` Marius Bakke
2020-01-10 1:48 ` [bug#39053] [PATCH 3/6] services: pulseaudio-configuration: Set flat-volumes to no Leo Prikler
2020-01-11 16:59 ` [bug#39053] [bug#39063] " Marius Bakke
2020-01-10 1:48 ` [bug#39065] [PATCH 4/6] services: Split ladspa-service-type from pulseaudio-service-type Leo Prikler
2020-01-11 17:00 ` [bug#39053] " Marius Bakke
2020-01-10 1:48 ` [bug#39053] [PATCH 5/6] doc: Add pulseaudio documentation Leo Prikler
2020-01-11 17:09 ` [bug#39064] " Marius Bakke
2020-01-11 17:25 ` [bug#39053] " Marius Bakke
2020-01-10 1:48 ` [bug#39066] [PATCH 6/6] services: Add pulseaudio to %desktop-services Leo Prikler
2020-01-11 17:10 ` [bug#39053] " Marius Bakke
2020-01-17 16:30 ` [bug#39053] [bug#39066] " Ludovic Courtès
2020-01-11 17:23 ` bug#38172: [bug#39053] [PATCH] Add pulseaudio configuration and fix volume bugs Marius Bakke
2020-01-11 18:37 ` Leo Prikler
2020-01-11 18:37 ` Leo Prikler
2020-01-11 23:49 ` Marius Bakke
2020-01-12 0:32 ` Leo Prikler
2020-01-12 19:55 ` Marius Bakke
2020-01-12 20:22 ` Leo Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200110014823.10595-1-leo.prikler@student.tugraz.at \
--to=leo.prikler@student.tugraz.at \
--cc=39053@debbugs.gnu.org \
--cc=39062@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.