Add MPD to audio service module

This commit is contained in:
June 2024-04-23 19:12:16 +02:00
commit 14bbdea9dc
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
4 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,33 @@
# Links & Resources:
# - https://mpd.readthedocs.io/en/stable/user.html
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.ccchh.services.audio;
in
{
config = mkIf cfg.enable {
services.mpd = {
enable = true;
network.listenAddress = "any";
extraConfig = ''
audio_output {
type "pipewire"
name "Pipewire"
}
'';
};
users.users.mpd.extraGroups = [ "pipewire" ];
networking.firewall = {
allowedTCPPorts = [ 6600 ];
};
};
}