;;; 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 linux) #: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? (alsa-plugins alsa-configuration-alsa-plugins ; (default alsa-plugins)) (pulseaudio? alsa-configuration-pulseaudio? ;boolean (default #t)) (extra-options alsa-configuration-extra-options ;string (default ""))) (define alsa-config-file ;; Return the ALSA configuration file. (match-lambda (($ 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\" hint { show on description \"Default ALSA Output (currently PulseAudio Sound Server)\" } } ctl.!default { type pulse fallback \"sysdefault\" }\n\n") '()) ,extra-options))))) (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 /image.scm (<image>)[max-layers]: New record field. Change-Id: I2726655aefd6688b976057fd5a38e9972ebfc292 Oleg Pykhalov 2022-09-24system: image: Add wsl2 support....* gnu/image.scm (<image>)[format]: Add wsl2 support. * gnu/system/image.scm (wsl2-image, wsl2-image-type): New variables. (image->root-file-system): Add wsl2 image support. (system-image): Ditto. Alex Griffin 2022-09-24system: image: Add tarball support....* gnu/image.scm (<image>)[fields]: Add tarball to the supported formats. * gnu/system/image.scm (tarball-image, tarball-image-type): New variables. (system-tarball-image): New procedure. (image->root-file-system): Add tarball image support. (system-image): Ditto. * doc/guix.texi ("System Images"): Document it. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Alex Griffin 2022-09-24image: Make the operating-system field mandatory....Make the operating-system field mandatory as creating an image without it makes no sense. Introduce a new macro, image-without-os for the specific cases where the image is only created to be inherited from afterwards. * gnu/image.scm (<image>)[operating-system]: Make it mandatory. * gnu/system/image.scm (image-without-os): New macro. (efi-disk-image, efi32-disk-image, iso9660-image, docker-image, raw-with-offset-disk-image): Use it. * gnu/system/images/hurd.scm (hurd-disk-image): Ditto. Mathieu Othacehe 2022-09-07image: Use #true and #false....* gnu/image.scm: Use #true and #false instead of #t and #f respectively. No functional change. Mathieu Othacehe 2022-09-07image: Use a default size partition value....* gnu/image.scm (<partition>)[size]: Default to 'guess like the image record. Mathieu Othacehe 2022-08-31image: Add comments....* gnu/image.scm: Add some comments across the whole module. Mathieu Othacehe 2022-08-30image: Remove an unused field....* gnu/image.scm (<partition>)[device]: Remove it. Mathieu Othacehe 2022-08-30image: Perform more sanitizing....* gnu/image.scm (validate-size, validate-partition-offset, validate-partition-flags): New macros. (<partition>)[size, offset, flags]: Sanitize those fields using the above procedures respectively. Mathieu Othacehe