summaryrefslogtreecommitdiff
path: root/gnu/services/audio.scm
AgeCommit message (Collapse)Author
2023-07-26Revert "services: mpd: Add an 'update' action to trigger a database update."Maxim Cournoyer
This reverts commit e1070ee16036f6dfb84c44aea4119e4db770356b. Rationale: this only works with the default 'endpoints'. The 'auto-update?' option should be sufficient to trigger a database update automatically anyway.
2023-07-26services: mpd: Provision a default cache directory and set HOME.Maxim Cournoyer
Relates to <https://issues.guix.gnu.org/63082>. * gnu/services/audio.scm (mpd-shepherd-service): Create a default .cache directory. Use mkdir-p/perms and refactor loop. Set the HOME environment variables.
2023-07-26services: mpd: Auto-detect mpd-output mixer type by default.Maxim Cournoyer
Relates to <https://issues.guix.gnu.org/63082>. * gnu/services/audio.scm (mpd-output) [mixer-type]: Change default value from "none" to unspecified. * doc/guix.texi (Audio Services): Regenerate doc.
2023-07-26services: Avoid 'delete' overrides warning in audio module.Maxim Cournoyer
* gnu/services/audio.scm: Hide 'delete' on (gnu services) import.
2023-07-26services: mpd: Do not rotate logs when using syslog.Maxim Cournoyer
* gnu/services/audio.scm (mpd-log-rotation): Conditionlize based on the value of LOG-FILE.
2023-07-26services: mpd: Log to syslog by default.Maxim Cournoyer
Rationale: the tristate value was awkward to deal with, the default log file name was odd (/var/log/mpd/log) and it required special attention to create the 'mpd' parent directory as root and chowning it to the MPD user. It also didn't match the default behavior of MPD, which is to log to systemd or syslog unless a log file is specified. * gnu/services/audio.scm (mpd-log-file-sanitizer): New procedure. (mpd-configuration) [log-file]: Remove default maybe value. Add sanitizer. (mpd-shepherd-service): Validate the log file parent directory exists and has the right permissions. Conditionally add syslogd to requirements. (mympd-log-to-sanitizer): New procedure. (mympd-configuration) [log-to]: Change type to maybe-string. Update doc and add sanitizer. (mympd-shepherd-service) [requirement]: Fix to use syslogd. Adjust accordingly. [start] Adjust accordingly. (mympd-log-rotation): Check log-to via maybe-value-set?. * doc/guix.texi (Audio Services): Update doc.
2023-07-26services: mpd; Refactor start slot directory initialization.Maxim Cournoyer
* gnu/services/audio.scm (mpd-shepherd-service): Standardize the way the log file parent and other directories are initialized in the start slot. (mympd-shepherd-service): Likewise.
2023-07-26services: mpd: List log-level in decreasing verbosity order in doc.Maxim Cournoyer
* gnu/services/audio.scm (mpd-configuration) [log-level]: List log-level in decreasing verbosity order in doc. * doc/guix.texi (Audio Services): Update doc.
2023-07-25services: mpd: Rename %set-user-group to set-user-group.Maxim Cournoyer
The convention to use % as a prefix is for "special" variables rather than procedures. * gnu/services/audio.scm (%set-user-group): Rename to... (set-user-group): ... this.
2023-07-25services: mpd: Streamline mpd-user-sanitizer and mympd-user-sanitizer.Maxim Cournoyer
* gnu/services/audio.scm (mpd-user-sanitizer, %mympd-user): Remove extraneous group field, already inherited. (%mpd-user, %mympd-user): Clarify %lazy-group explanatory comment. Fix indentation.
2023-07-25services: mpd: Add an 'update' action to trigger a database update.Maxim Cournoyer
* gnu/services/audio.scm (mpd-shepherd-service): Register a new update action. * doc/guix.texi (Audio Services): Document it.
2023-07-25services: mpd: Add auto-update? field to mpd-configuration.Maxim Cournoyer
* gnu/services/audio.scm (mpd-configuration) [auto-update?]: New field. * doc/guix.texi (Audio Services): Update doc.
2023-04-02services: mympd: Use records for user and group fields.Bruno Victal
* gnu/services/audio.scm (%mympd-user, %mympd-group) (mympd-user-sanitizer, mympd-group-sanitizer): New variables. (mympd-configuration)[user]: Use user-account as value type. Sanitize via mympd-user-sanitizer. [group]: Use user-group as value type. Sanitize via mympd-group-sanitizer. (mympd-serialize-configuration): Adjust accordingly. (mympd-accounts): Likewise. * doc/guix.texi (Audio Services)[myMPD]: Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-04-02services: mpd: Use proper records for user and group fields.Bruno Victal
Deprecate using strings for these fields and prefer user-account (resp. user-group) instead to avoid duplication within account-service-type. Fixes #61570 <https://issues.guix.gnu.org/61570>. * gnu/services/audio.scm (%mpd-user, %mpd-group) (mpd-serialize-user-account, mpd-serialize-user-group) (mpd-user-sanitizer, mpd-group-sanitizer): New variables. (mpd-configuration)[user]: Use user-account as value type. Sanitize via mpd-user-sanitizer. [group]: Use user-group as value type. Sanitize via mpd-group-sanitizer. (mpd-shepherd-service): Adjust accordingly. (mpd-accounts): Likewise. * doc/guix.texi (Audio Services)[Music Player Daemon]: Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-04-02services: mpd: Fix unintentional API breakage for mixer-type field.Bruno Victal
* gnu/services/audio.scm (mpd-output)[mixer-type]: Use sanitizer to accept both strings and symbols as values. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-04-02services: replace bare serializers with (serializer ...)Bruno Victal
* gnu/home/services/shells.scm (home-zsh-configuration)[environment-variables]: Use (serializer ...). (home-bash-configuration)[aliases, environment-variables]: Likewise. (home-fish-configuration)[abbreviations, aliases] [environment-variables]: Likewise. * gnu/services/audio.scm (mpd-configuration)[music-dir, playlist-dir] [endpoints, address, inputs, archive-plugins, input-cache-size] [decoders, filters, playlist-plugins]: Likewise. * gnu/services/linux.scm (fstrim-configuration)[extra-arguments]: Likewise. * gnu/services/security.scm (fail2ban-jail-configuration)[backend] [log-encoding, extra-content]: Likewise. * tests/services/configuration.scm: Update tests. ("serialize-configuration [deprecated]"): New test. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-03-24services: mpd: Set PulseAudio-related variables.Bruno Victal
These variables are necessary for PulseAudio to work properly out-of-the-box for 'non-interactive' users. * doc/guix.texi (Audio Services): Update environment-variables field description for mpd-configuration data type. * gnu/services/audio.scm (mpd-configuration)[environment-variables]: Set PULSE_CLIENTCONFIG and PULSE_CONFIG environment variables to the system-wide PulseAudio configuration. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-03-24services: audio: Remove redundant list-of-string? predicate.Bruno Victal
Use list-of-strings? predicate defined in (gnu services configuration). * gnu/services/audio.scm (list-of-string?): Remove predicate. (mpd-serialize-list-of-string): Rename procedure to ... (mpd-serialize-list-of-strings): ... this. (mpd-configuration)[environment-variables]: Switch to list-of-strings. [endpoints]: Switch to maybe-list-of-strings. (mympd-ip-acl)[allow, deny]: Switch to list-of-strings. (mympd-serialize-configuration): Rename serialize-list-of-string to serialize-list-of-strings. * doc/guix.texi (Audio Services): Update it. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-03-24services: mympd: Require 'syslog service when configured to log to syslog.Bruno Victal
* gnu/services/audio.scm (mympd-shepherd-service): Depend on 'syslog when configured to log to syslog. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-02-05services: mpd: Fix serialization procedure for list-of-string.Bruno Victal
This is a followup to commit 5c5f0fc1135ff15f9c4adfc5f27eadd9a592b5d1 * gnu/services/audio.scm (mpd-serialize-list-of-string): Fix serialization procedure. Signed-off-by: Leo Famulari <leo@famulari.name>
2023-02-05services: Add mympd-service-type.Bruno Victal
* gnu/services/audio.scm (mympd-service-type): New variable. * gnu/tests/audio.scm (%test-mympd): New variable. * doc/guix.texi: Document it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-02-05services: mpd: Do not hardcode environment variables.Bruno Victal
Services should not expect for XDG_RUNTIME_DIR to be set. Inferring from the past comment, this seemed to resolve an issue when the service was launched with an _interactive_ user-account, which tends to have this variable set by the login-manager. This is not the case for system accounts and setting this variable results in PulseAudio (launched by the same system user) failing to start since it attempts to use a nonexistent directory. Ideally, this service should have a home-service counterpart but the old behavior can be emulated by setting the environment-variables field to: (environment-variables (list (string-append "XDG_RUNTIME_DIR=/run/user/" (number->string (passwd:uid (getpwnam "myuser")))))) * gnu/services/audio.scm (mpd-configuration)[environment-variables]: New field. (mpd-shepherd-service)[start]: Use new field. * doc/guix.texi (Audio Services)[Music Player Daemon]: Document it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-02-05services: mpd: Refactor MPD service.Bruno Victal
Refactor mpd-service-type to support additional mpd.conf directives and move activation-service-extension into service constructor. * gnu/services/audio.scm (mpd-plugin, mpd-partition): New records. (mpd-serialize-boolean): Alias to and integrate logic into... (mpd-serialize-field): ... this. (mpd-serialize-list-of-string): New variable. (mpd-plugin?, mpd-partition?, list-of-string?, list-of-symbol?) (list-of-mpd-plugin?, list-of-mpd-partition?) (list-of-mpd-plugin-or-output?, port?): New variables. (mpd-file-name, mpd-service-activation): Remove variables. (mpd-configuration) [package, group, shepherd-requirement, log-file, log-level, music-directory] [playlist-directory, endpoints, database, partitions, neighbors, inputs] [archive-plugins, input-cache-size, decoders, resampler, filters] [playlist-plugins, extra-options]: New fields. [music-dir, playlist-dir, address]: Deprecate shorthand fields. [db-file, state-file, sticker-file, port, outputs]: Change admissible type. (mpd-shepherd-service) [actions]: New shepherd actions: 'reopen' and 'configuration'. [requirement]: Splice with 'shepherd-requirement' field. [start]: Use 'package' field. Remove #:log-file parameter. Move activation-service extension into constructor. (mpd-accounts): Honor user and group names from configuration. (mpd-log-rotation): New procedure. (mpd-service-type)[extensions]: Add rottlog-service-type extension. Remove activation-service-type extension. (mpd-output-name, mpd-output-type, mpd-output-enabled?, mpd-output-format) (mpd-output-tags?, mpd-output-always-on?, mpd-output-mixer-type) (mpd-output-replay-gain-handler, mpd-output-extra-options) (mpd-plugin-plugin, mpd-plugin-name, mpd-plugin-enabled?) (mpd-plugin-extra-options) (mpd-partition-name, mpd-partition-extra-options) (mpd-configuration-package, mpd-configuration-user) (mpd-configuration-group, mpd-configuration-shepherd-requirement) (mpd-configuration-log-file, mpd-configuration-log-level) (mpd-configuration-music-directory, mpd-configuration-music-dir) (mpd-configuration-playlist-directory, mpd-configuration-playlist-dir) (mpd-configuration-db-file, mpd-configuration-state-file) (mpd-configuration-sticker-file, mpd-configuration-default-port) (mpd-configuration-endpoints, mpd-configuration-address) (mpd-configuration-database, mpd-configuration-partitions) (mpd-configuration-neighbors, mpd-configuration-inputs) (mpd-configuration-archive-plugins, mpd-configuration-input-cache-size) (mpd-configuration-decoders, mpd-configuration-resampler) (mpd-configuration-filters, mpd-configuration-outputs) (mpd-configuration-playlist-plugins, mpd-configuration-extra-options): Export accessors. * doc/guix.texi (Audio Services)[Music Player Daemon]: Update documentation. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2023-02-05services: mpd: Rewrite using 'define-configuration'.Bruno Victal
* gnu/services/audio.scm (mpd-configuration, mpd-output): Rewrite using define-configuration. (uglify-field-name, mpd-serialize-field, mpd-serialize-alist) (mpd-serialize-number, mpd-serialize-boolean, mpd-serialize-list-of-mpd-output) (mpd-serialize-configuration): New procedure. (list-of-mpd-output?): New predicate. (mpd-config->file, mpd-output->string): Remove procedure. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2020-12-06services: mpd: Make /var/run/mpd/USER user-owned.Ludovic Courtès
Fixes <https://bugs.gnu.org/44820>. Reported by Simon <lists@netpanic.org>. This is a followup to bb124f6e9c0af0a23736f233c2ea2c9c9b4a40a6. * gnu/services/audio.scm (mpd-service-activation): Chown the parent of DIRECTORY as well.
2020-11-06services: mpd: Fix daemon startup.Ludovic Courtès
Until now it would wait for a PID file that'd never come. * gnu/services/audio.scm (mpd-shepherd-service): Add 'requirement'. Remove #:pid-file from 'start'. (mpd-service-activation): Create the ".mpd" directory since that's what the daemon expects.
2020-11-06services: mpd: Always create the "mpd" user account.Ludovic Courtès
* gnu/services/audio.scm (%mpd-accounts): New variable. (mpd-service-type)[extensions]: Add ACCOUNT-SERVICE-TYPE extension.
2020-11-06services: mpd: Do not eagerly look for a user.Maxim Cournoyer
Running 'guix system search mpd' would throw a backtrace because the mpd-shepherd-service service start Gexp contained an unquoted call to 'getpwnam', which would look for a missing 'mpd' user and fail. * gnu/services/audio.scm (mpd-shepherd-service): gexp-unquote only the relevant variable rather than the whole expression.
2020-05-13services: Add missing import.Ludovic Courtès
* gnu/services/audio.scm: Import (ice-9 format).
2019-11-08services: mpd: Connect to the user's PulseAudio socket.Robert Smith
* gnu/services/audio.scm (mpd-shepherd-service): Set the XDG_RUNTIME_DIR environment variable. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2019-10-29gnu: mpd-service-type: Support configuration of outputs.Ricardo Wurmus
* gnu/services/audio.scm (<mpd-output>): New record type. (<mpd-configuration>)[outputs]: New field. (mpd-output, mpd-output?, mpd-output->string): New procedures. (mpd-config->file): Use mpd-output->string. * doc/guix.texi (Audio Services): Document mpd-output fields.
2019-03-15services: mpd: add more configuration optionsnixo
* gnu/services/audio.scm (<mpd-configuration>): Add 'db-file', 'state-file' and 'sticker-file' fields. * doc/guix.texi (Music Player Daemon): Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-11-05services: Add 'description' fields.Ludovic Courtès
* gnu/services/admin.scm (rottlog-service-type) (tailon-service-type): Add 'description' field. * gnu/services/audio.scm (mpd-service-type): Likewise. * gnu/services/avahi.scm (avahi-service-type): Likewise. * gnu/services/ssh.scm (lsh-service-type) (openssh-service-type, dropbear-service-type): Likewise.
2017-08-31services: mpd: Remove the mpd-file field.Peter Mikkelsen
Since MPD switches user, the pid-file must be in a writable dir. This is now always /var/run/mpd/(user)/pid. * gnu/services/audio.scm (mpd-service-type): Add a activation-service extension. (<mpd-configuration>)[pid-file]: Remove. (mpd-service): Rename to... (mpd-shepherd-service): ... this. (mpd-file-name, mpd-service-activation): New procedure. * doc/guix.texi (Audio Services): Document the changes. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-08-13gnu: Add mpd service.Peter Mikkelsen
* doc/guix.texi: Add documentation. * gnu/services/audio.scm (<mpd-configuration>): New record type. (mpd-service-type): New service type. * gnu/tests/audio.scm: New file. * gnu/local.mk: Add new files. Signed-off-by: Christopher Baines <mail@cbaines.net>