diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-06-26 13:51:26 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-06-26 13:51:26 +0200 |
commit | a167873c67a17df8175f896750de2d905d0fae04 (patch) | |
tree | e84bd2845b5456ef67e7337f54bdb3cc2e5b7512 /gnu/services/sound.scm | |
parent | 7c3bea7e6299e1026c7964c83986a6b6c220879a (diff) | |
parent | 7c7323e432620a42f896056f076020a748c1fd6d (diff) | |
download | patches-a167873c67a17df8175f896750de2d905d0fae04.tar patches-a167873c67a17df8175f896750de2d905d0fae04.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/sound.scm')
-rw-r--r-- | gnu/services/sound.scm | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 5fe555e8b6..f2dd24402f 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -26,6 +26,7 @@ #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) + #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) #:use-module (ice-9 match) #:export (alsa-configuration @@ -44,17 +45,31 @@ (define-record-type* <alsa-configuration> alsa-configuration make-alsa-configuration alsa-configuration? + (alsa-plugins alsa-configuration-alsa-plugins ;<package> + (default alsa-plugins)) (pulseaudio? alsa-configuration-pulseaudio? ;boolean (default #t)) (extra-options alsa-configuration-extra-options ;string (default ""))) -(define (alsa-config-file config) - "Return the ALSA configuration file corresponding to CONFIG." - (plain-file "asound.conf" - (string-append "# Generated by 'alsa-service'.\n\n" - (if (alsa-configuration-pulseaudio? config) - "# Use PulseAudio by default +(define alsa-config-file + ;; Return the ALSA configuration file. + (match-lambda + (($ <alsa-configuration> alsa-plugins pulseaudio? extra-options) + (apply mixed-text-file "asound.conf" + `("# Generated by 'alsa-service'.\n\n" + ,@(if pulseaudio? + `("# Use PulseAudio by default +pcm_type.pulse { + lib \"" ,#~(string-append #$alsa-plugins:pulseaudio + "/lib/alsa-lib/libasound_module_pcm_pulse.so") "\" +} + +ctl_type.pulse { + lib \"" ,#~(string-append #$alsa-plugins:pulseaudio + "/lib/alsa-lib/libasound_module_ctl_pulse.so") "\" +} + pcm.!default { type pulse fallback \"sysdefault\" @@ -67,10 +82,9 @@ pcm.!default { ctl.!default { type pulse fallback \"sysdefault\" -} -" - "") - (alsa-configuration-extra-options config)))) +}\n\n") + '()) + ,extra-options))))) (define (alsa-etc-service config) (list `("asound.conf" ,(alsa-config-file config)))) |