From c975889e31e3466baa48bf94fd2569838b579197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Wed, 28 Mar 2018 14:58:14 -0400 Subject: add mpd service --- config/mpd.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 config/mpd.nix 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" + } + ''; + }; +} -- cgit v1.2.3