37 lines
1.2 KiB
Nix
37 lines
1.2 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: 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;
|
|
};
|
|
services = {
|
|
mpd = {
|
|
enable = true;
|
|
musicDirectory = audio_dir;
|
|
playlistDirectory = playlist_dir;
|
|
network.listenAddress = "::";
|
|
extraConfig = ''
|
|
audio_output {
|
|
type "pulse"
|
|
name "Pulseaudio"
|
|
}
|
|
'';
|
|
};
|
|
mpdris2.enable = true;
|
|
};
|
|
}
|