Move audio configuration into a service module
- Move audio configuration into a service module to make it easily usable by multiple hosts. - Allow configuration of AirPlay 2 name. - Don't set MQTT topic of Shairport-Sync (AirPlay 2) explictly. Defaults to hostname now. - Don't set sound.enable anymore, since its not needed.
This commit is contained in:
parent
8355a6f635
commit
c9310374af
13 changed files with 246 additions and 155 deletions
35
modules/services/audio/default.nix
Normal file
35
modules/services/audio/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.ccchh.services.audio;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
./librespot.nix
|
||||
./networking.nix
|
||||
./pipewire.nix
|
||||
./shairport-sync.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
ccchh.services.audio = {
|
||||
enable = mkEnableOption (lib.mdDoc "audio");
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
example = "Audio Living Room";
|
||||
default = config.networking.hostName;
|
||||
defaultText = literalExpression "config.networking.HostName";
|
||||
description = lib.mdDoc ''
|
||||
The name to use for display in the various audio services. For example
|
||||
the name of the displayed Spotify speaker or AirPlay audio device.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue