2024-09-07 00:38:19 -04:00
|
|
|
{pkgs, outputs, ...}: {
|
2024-08-26 20:45:07 -04:00
|
|
|
# Icecast, replacing Azuracast maybe
|
|
|
|
services = {
|
|
|
|
icecast = {
|
|
|
|
enable = true;
|
|
|
|
listen.port = 265;
|
2024-08-30 01:17:50 -04:00
|
|
|
hostname = "icecast.${outputs.secrets.jimDomain}";
|
2024-08-26 20:45:07 -04:00
|
|
|
admin = {
|
|
|
|
user = "jimbo";
|
2024-09-07 00:38:19 -04:00
|
|
|
password = "${outputs.secrets.castAdminPass}";
|
2024-08-26 20:45:07 -04:00
|
|
|
};
|
2024-09-07 00:38:19 -04:00
|
|
|
extraConf = ''
|
|
|
|
<authentication>
|
|
|
|
<source-password>${outputs.secrets.castSourcePass}</source-password>
|
|
|
|
</authentication>
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
liquidsoap.streams = let
|
|
|
|
jimbops = ''
|
|
|
|
# CONFIGURATION
|
|
|
|
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
|
|
|
|
jimbops = mksafe(normalize(playlist(mode='randomize', reload=1, reload_mode="rounds", "/export/JimboNFS/Music/")))
|
|
|
|
|
|
|
|
# Ensure the stream never stops
|
|
|
|
jimbops_fallback = fallback([jimbops, jimbops])
|
|
|
|
|
|
|
|
# Output configuration to Icecast
|
|
|
|
output.icecast(
|
|
|
|
%vorbis(channels=2, samplerate=48000, quality=0.8),
|
|
|
|
host="127.0.0.1",
|
|
|
|
port=265,
|
|
|
|
password="${outputs.secrets.castSourcePass}",
|
|
|
|
description="JimBops Radio",
|
|
|
|
url="https://icecast.jimbosfiles.com/jimbops.opus",
|
|
|
|
public=true,
|
|
|
|
icy_metadata=["artist", "title"],
|
|
|
|
genre="My personal music folder.",
|
|
|
|
mount="jimbops.opus",
|
|
|
|
jimbops_fallback
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
JimBops = pkgs.writeText "liquidjim" jimbops;
|
2024-08-26 20:45:07 -04:00
|
|
|
};
|
2024-08-30 01:17:50 -04:00
|
|
|
nginx.virtualHosts."icecast.${outputs.secrets.jimDomain}" = {
|
2024-08-26 20:45:07 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:265";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|