};
networking.firewall.allowedTCPPorts = [ 6600 ];
users.users.mpd.extraGroups = [ "wwwrun" "keys" ];
+ system.activationScripts.mpd = ''
+ install -d -m 0755 -o mpd -g mpd /run/mpd
+ '';
services.mpd = {
enable = true;
network.listenAddress = "any";
type "httpd"
name "OGG"
encoder "vorbis"
- port "${myconfig.env.ports.mpd_ogg}"
- bind_to_address "127.0.0.1"
+ bind_to_address "/run/mpd/ogg.sock"
quality "5.0"
format "44100:16:1"
}
type "httpd"
name "MP3"
encoder "lame"
- port "${myconfig.env.ports.mpd_mp3}"
- bind_to_address "127.0.0.1"
+ bind_to_address "/run/mpd/mp3.sock"
quality "5.0"
format "44100:16:1"
}
ProxyPass ws://${config.webPort}/ws
</Location>
<Location "/mpd/music.mp3">
- ProxyPass http://localhost:${env.mp3port}/
- ProxyPassReverse http://localhost:${env.mp3port}/
+ ProxyPass unix:///run/mpd/mp3.sock|http://tools.immae.eu/
+ ProxyPassReverse unix:///run/mpd/mp3.sock|http://tools.immae.eu/
</Location>
<Location "/mpd/music.ogg">
- ProxyPass http://localhost:${env.oggport}/
- ProxyPassReverse http://localhost:${env.oggport}/
+ ProxyPass unix:///run/mpd/ogg.sock|http://tools.immae.eu/
+ ProxyPassReverse unix:///run/mpd/ogg.sock|http://tools.immae.eu/
</Location>
'';
};