nix-config/lib/mpd.nix

26 lines
585 B
Nix
Raw Normal View History

2019-07-02 21:11:32 +02:00
{ config, pkgs, lib, ... }:
let
2019-09-07 13:23:17 +02:00
hostMpd = if config.networking.hostName == "storage-ng" then {
musicDirectory = "/mnt/cephfs/c3d2/rpool/Music";
extraConfig = ''
audio_output {
name "null"
type "null"
}
'';
} else {
dbFile = null;
musicDirectory = "/mnt/storage/Music";
playlistDirectory = "/home/k-ot/Playlists";
2019-09-07 13:23:17 +02:00
};
in {
c3d2.hq.enableMpdProxy = true;
2019-07-02 21:11:32 +02:00
services.mpd = (hostMpd // {
2019-09-07 13:23:17 +02:00
enable = true;
2019-07-02 21:11:32 +02:00
network.listenAddress = "any";
});
2019-09-07 13:23:17 +02:00
networking.firewall.allowedTCPPorts = [ config.services.mpd.network.port ];
2019-07-02 21:11:32 +02:00
}