;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu services sound) #:use-module (gnu services base) #:use-module (gnu services configuration) #:use-module (gnu services shepherd) #:use-module (gnu services) #:use-module (gnu system shadow) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) #:use-module (gnu packages pulseaudio) #:use-module (ice-9 match) #:export (alsa-configuration alsa-service-type)) ;;; Commentary: ;;; ;;; Sound services. ;;; ;;; Code: ;;; ;;; ALSA ;;; (define-record-type* alsa-configuration make-alsa-configuration alsa-configuration? (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 pcm.!default { type pulse fallback \"sysdefault\" hint { show on description \"Default ALSA Output (currently PulseAudio Sound Server)\" } } ctl.!default { type pulse fallback \"sysdefault\" } " "") (alsa-configuration-extra-options config)))) (define (alsa-etc-service config) (list `("asound.conf" ,(alsa-config-file config)))) (define alsa-service-type (service-type (name 'alsa) (extensions (list (service-extension etc-service-type alsa-etc-service))) (default-value (alsa-configuration)) (description "Configure low-level Linux sound support, ALSA."))) ;;; sound.scm ends here r> 2024-02-29nls: Update translations....Florian Pelz 2023-05-31nls: Update translations....Florian Pelz 2023-03-07nls: Update translations.Julien Lepiller 2022-12-04nls: Update translations....Julien Lepiller 2022-11-04nls: Update translations....Julien Lepiller 2022-10-06nls: Update translations.Julien Lepiller 2022-09-04nls: Update translations.Julien Lepiller 2022-08-10nls: Update translations....Julien Lepiller 2022-07-09nls: Update translations....Julien Lepiller 2022-06-04nls: Update translations....Julien Lepiller 2022-05-01nls: Update translations....Julien Lepiller 2022-04-02nls: Update translations....Julien Lepiller 2022-03-01nls: Update translations....Julien Lepiller 2022-02-04nls: Update translations....Julien Lepiller 2022-01-09nls: Update translations....Julien Lepiller 2021-12-04nls: Update translations.Julien Lepiller 2021-11-06nls: Update translations....Julien Lepiller 2021-10-17nls: Update translations.Julien Lepiller 2021-09-02nls: Update translations....Julien Lepiller 2021-08-04nls: Update translations....Julien Lepiller