2022-03-08 01:42:46 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2022-03-28 13:46:20 +00:00
|
|
|
}: let
|
|
|
|
audio_dir = "${config.home.homeDirectory}/media/audio";
|
|
|
|
playlist_dir = "${audio_dir}/playlists";
|
|
|
|
in {
|
|
|
|
home.file."media/audio/playlists" = {
|
|
|
|
source = pkgs.setToDirectories (lib.mapAttrs' (name: content: lib.nameValuePair "${name}.m3u" (builtins.toFile "${name}.m3u" content)) {
|
|
|
|
"radio-swiss-classic" = "https://stream.srg-ssr.ch/m/rsc_de/aacp_96";
|
|
|
|
"radio-swiss-jazz" = "https://stream.srg-ssr.ch/m/rsj/aacp_96";
|
|
|
|
"br-klassik" = "http://dispatcher.rndfnk.com/br/brklassik/live/mp3/high";
|
|
|
|
"klassik-radio-games" = "https://klassikr.streamabc.net/klr-games-mp3-128-1540253";
|
|
|
|
"klassik-radio-movie" = "https://klassikr.streamabc.net/klr-movie-mp3-128-5213277";
|
|
|
|
"radio-caprice-power-metal" = "http://79.120.77.11:8000/powermetal";
|
|
|
|
"metal-hammer" = "https://metal-hammer.stream.laut.fm/metal-hammer";
|
|
|
|
});
|
|
|
|
recursive = true;
|
|
|
|
};
|
2020-07-03 13:07:03 +00:00
|
|
|
services = {
|
|
|
|
mpd = {
|
|
|
|
enable = true;
|
2022-03-28 13:46:20 +00:00
|
|
|
musicDirectory = audio_dir;
|
|
|
|
playlistDirectory = playlist_dir;
|
2022-03-28 22:30:28 +00:00
|
|
|
network.listenAddress = "::";
|
2020-07-03 13:07:03 +00:00
|
|
|
extraConfig = ''
|
|
|
|
audio_output {
|
2022-03-28 13:46:20 +00:00
|
|
|
type "pulse"
|
|
|
|
name "Pulseaudio"
|
2020-07-03 13:07:03 +00:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
mpdris2.enable = true;
|
|
|
|
};
|
|
|
|
}
|