2024-12-22 22:02:10 -05:00
|
|
|
{ pkgs, lib, config, ... }:
|
2024-11-04 22:41:38 -05:00
|
|
|
{
|
2025-01-01 16:54:27 -05:00
|
|
|
config = lib.mkIf config.services.icecast.enable {
|
2025-01-16 00:41:00 -05:00
|
|
|
services.liquidsoap.streams = {
|
2025-01-01 16:54:27 -05:00
|
|
|
jimscrapped = pkgs.writeText "jimscrapped" ''
|
|
|
|
settings.log.stdout.set(true)
|
|
|
|
settings.init.allow_root.set(true)
|
|
|
|
settings.scheduler.fast_queues.set(2)
|
|
|
|
|
2025-01-03 18:03:07 -05:00
|
|
|
jimscrapped = mksafe(playlist(mode='randomize', reload=1, reload_mode="rounds", "/export/KittyNFS/Music/JimScrapped"))
|
2025-01-01 16:54:27 -05:00
|
|
|
jimscrapped_fallback = fallback([jimscrapped, jimscrapped])
|
|
|
|
|
|
|
|
output.icecast(
|
|
|
|
%ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)),
|
|
|
|
host="127.0.0.1",
|
2025-01-16 00:41:00 -05:00
|
|
|
port=${toString config.services.icecast.listen.port},
|
2025-01-01 16:54:27 -05:00
|
|
|
password="${config.secrets.castSourcePass}",
|
|
|
|
encoding = "UTF-8",
|
2024-11-13 04:10:42 -05:00
|
|
|
|
2025-01-01 16:54:27 -05:00
|
|
|
name="Jimbo's Scrap",
|
|
|
|
genre="Scrapped",
|
|
|
|
description="Music canned from the main radio.",
|
|
|
|
mount="jimscrapped.opus",
|
|
|
|
icy_metadata=["artist", "title"],
|
|
|
|
public=true,
|
2024-11-13 04:10:42 -05:00
|
|
|
|
2025-01-01 16:54:27 -05:00
|
|
|
jimscrapped_fallback
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# Avoid the most stupid error imaginable
|
|
|
|
systemd.services.jimscrapped = {
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
wants = [ "network-online.target" ];
|
|
|
|
};
|
2024-12-22 22:02:10 -05:00
|
|
|
};
|
2024-11-04 22:41:38 -05:00
|
|
|
}
|