nix-config/lib/mpd.nix

31 lines
666 B
Nix

{ config, pkgs, lib, ... }:
let
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";
extraConfig = ''
database {
plugin "proxy"
host "storage-ng.hq.c3d2.de"
}
'';
};
in {
services.mpd = (hostMpd // {
enable = true;
network.listenAddress = "any";
});
networking.firewall.allowedTCPPorts = [ config.services.mpd.network.port ];
}