2024-10-15 17:46:44 -04:00
|
|
|
{ pkgs, config, ... }:
|
2024-10-09 03:36:08 -04:00
|
|
|
{
|
2024-10-07 11:42:34 -04:00
|
|
|
imports = [
|
|
|
|
./nginx
|
|
|
|
];
|
|
|
|
|
2024-08-26 20:45:07 -04:00
|
|
|
services = {
|
|
|
|
icecast = {
|
|
|
|
enable = true;
|
|
|
|
listen.port = 265;
|
2024-10-24 23:42:09 -04:00
|
|
|
hostname = "icecast.${config.domains.jim1}";
|
2024-08-26 20:45:07 -04:00
|
|
|
admin = {
|
|
|
|
user = "jimbo";
|
2024-10-15 17:46:44 -04:00
|
|
|
password = "${config.secrets.castAdminPass}";
|
2024-08-26 20:45:07 -04:00
|
|
|
};
|
2024-09-07 00:38:19 -04:00
|
|
|
extraConf = ''
|
|
|
|
<authentication>
|
2024-10-15 17:46:44 -04:00
|
|
|
<source-password>${config.secrets.castSourcePass}</source-password>
|
2024-09-07 00:38:19 -04:00
|
|
|
</authentication>
|
2024-10-09 03:36:08 -04:00
|
|
|
|
|
|
|
<location>Canada</location>
|
2024-10-24 23:42:09 -04:00
|
|
|
<admin>jimbo@${config.domains.jim2}</admin>
|
2024-10-09 03:36:08 -04:00
|
|
|
|
2024-09-09 00:58:41 -04:00
|
|
|
<mount type="normal">
|
|
|
|
<mount-name>/jimbops.opus</mount-name>
|
|
|
|
<stream-name>JimBops Radio</stream-name>
|
|
|
|
<stream-description>Music gathered by me, Jimbo.</stream-description>
|
|
|
|
<stream-url>https://icecast.jimbosfiles.com/jimbops.opus</stream-url>
|
|
|
|
<genre>Anything</genre>
|
|
|
|
<type>application/ogg</type>
|
|
|
|
<subtype>vorbis</subtype>
|
|
|
|
</mount>
|
2024-09-07 00:38:19 -04:00
|
|
|
'';
|
|
|
|
};
|
2024-09-09 00:58:41 -04:00
|
|
|
|
|
|
|
# The audio stream
|
2024-10-07 11:42:34 -04:00
|
|
|
liquidsoap.streams = {
|
|
|
|
jimbops = pkgs.writeText "liquidjim" ''
|
2024-09-07 00:38:19 -04:00
|
|
|
settings.log.stdout.set(true)
|
|
|
|
settings.init.allow_root.set(true)
|
|
|
|
settings.scheduler.fast_queues.set(2)
|
|
|
|
settings.decoder.file_extensions.mp4.set(["m4a", "m4b", "m4p", "m4v", "m4r", "3gp", "mp4"])
|
|
|
|
|
|
|
|
# Define the source with random playlist
|
2024-09-07 11:40:18 -04:00
|
|
|
jimbops = mksafe(playlist(mode='randomize', reload=1, reload_mode="rounds", "/export/JimboNFS/Music/"))
|
2024-09-07 00:38:19 -04:00
|
|
|
|
|
|
|
# Ensure the stream never stops
|
|
|
|
jimbops_fallback = fallback([jimbops, jimbops])
|
|
|
|
|
|
|
|
# Output configuration to Icecast
|
|
|
|
output.icecast(
|
2024-09-07 11:40:18 -04:00
|
|
|
%ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)),
|
2024-09-07 00:38:19 -04:00
|
|
|
host="127.0.0.1",
|
|
|
|
port=265,
|
2024-10-15 17:46:44 -04:00
|
|
|
password="${config.secrets.castSourcePass}",
|
2024-09-07 00:38:19 -04:00
|
|
|
public=true,
|
|
|
|
icy_metadata=["artist", "title"],
|
|
|
|
mount="jimbops.opus",
|
2024-09-07 11:40:18 -04:00
|
|
|
encoding = "UTF-8",
|
2024-09-07 00:38:19 -04:00
|
|
|
jimbops_fallback
|
|
|
|
)
|
|
|
|
'';
|
2024-08-26 20:45:07 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|