{ config, lib, pkgs, ... }: { config = lib.mkIf config.services.icecast.enable { services.liquidsoap.streams = { nixbops = pkgs.writeText "nixbops" '' settings.log.stdout.set(true) settings.init.allow_root.set(true) settings.scheduler.fast_queues.set(2) stream = mksafe(playlist(mode='randomize', reload=1, reload_mode="rounds", "/storage/Music/NixBops")) stream_fallback = fallback([stream, stream]) output.icecast( %ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)), host="127.0.0.1", port=${toString config.services.icecast.listen.port}, password="${config.secrets.cast.sourcePass}", encoding = "UTF-8", name="NixBops Radio", genre="Anything", description="Random collection of downloaded music.", mount="nixbops.opus", icy_metadata=["artist", "title"], public=true, stream_fallback ) ''; }; # Avoid the most stupid error imaginable systemd.services.nixbops = { after = [ "network-online.target" ]; wants = [ "network-online.target" ]; }; }; }