diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/mpd.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/config/mpd.nix b/config/mpd.nix new file mode 100644 index 0000000..7815f61 --- /dev/null +++ b/config/mpd.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + let mpdport = (import ../data/aliases.nix).services.mpd.port; + mpdwebport = (import ../data/aliases.nix).services.mpdweb.port; + in +{ + networking.firewall.allowedTCPPorts = [ mpdport mpdwebport ]; + + services.ympd = { + enable = true; + webPort = toString mpdwebport; + }; + + services.mpd = { + enable = true; + musicDirectory = "/storage/music"; + extraConfig = '' + audio_output { + type "httpd" + name "KJ mpd stream" + encoder "lame" + port "${toString mpdport}" + quality "0" # do not define if bitrate is defined + #bitrate "128" # do not define if quality is defined + format "44100:16:1" + always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. + tags "yes" # httpd supports sending tags to listening streams. + audio_buffer_size "8192" + } + ''; + }; +} |