2020-02-17 17:00:59 +04:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
{
|
|
|
|
services.mopidy = {
|
|
|
|
enable = true;
|
2020-04-30 15:33:26 +04:00
|
|
|
extensionPackages = with pkgs; [ mopidy-mpd mopidy-gmusic ];
|
2020-02-17 17:00:59 +04:00
|
|
|
configuration = (if (!isNull config.secrets.gpmusic) then ''
|
|
|
|
[gmusic]
|
|
|
|
username = ${config.secrets.gpmusic.user}
|
2020-04-30 15:56:01 +04:00
|
|
|
refresh_token = ${config.secrets.gpmusic.password}
|
2020-02-17 17:00:59 +04:00
|
|
|
deviceid = ${config.secrets.gpmusic.deviceid}
|
|
|
|
bitrate = 128
|
|
|
|
'' else
|
|
|
|
"") + ''
|
|
|
|
[mpd]
|
|
|
|
hostname = 0.0.0.0
|
|
|
|
[audio]
|
|
|
|
output = pulsesink server=127.0.0.1
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.mopidy = {
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|