summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Ørbekk <kj@orbekk.com>2018-03-28 14:58:14 -0400
committerKjetil Ørbekk <kj@orbekk.com>2018-03-28 14:58:14 -0400
commitc975889e31e3466baa48bf94fd2569838b579197 (patch)
tree210cc96f59eb2250b8babfa6e36aa1ead1a84a46
parent528fe09269f3a0deb590ebfc94b4c39b9ace8616 (diff)
add mpd service
-rw-r--r--config/mpd.nix31
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"
+ }
+ '';
+ };
+}