Update references and folder names
This commit is contained in:
parent
4cafc51f01
commit
d402b1c806
82 changed files with 88 additions and 88 deletions
78
system/server/icecast.nix
Normal file
78
system/server/icecast.nix
Normal file
|
@ -0,0 +1,78 @@
|
|||
{pkgs, outputs, ...}: {
|
||||
# Icecast, replacing Azuracast maybe
|
||||
services = {
|
||||
# The host service
|
||||
icecast = {
|
||||
enable = true;
|
||||
listen.port = 265;
|
||||
hostname = "icecast.${outputs.secrets.jimDomain}";
|
||||
admin = {
|
||||
user = "jimbo";
|
||||
password = "${outputs.secrets.castAdminPass}";
|
||||
};
|
||||
extraConf = ''
|
||||
<authentication>
|
||||
<source-password>${outputs.secrets.castSourcePass}</source-password>
|
||||
</authentication>
|
||||
|
||||
<location>Canada</location>
|
||||
<admin>jimbo@jimbosfiles.com</admin>
|
||||
|
||||
<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>
|
||||
'';
|
||||
};
|
||||
|
||||
# The audio stream
|
||||
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(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(
|
||||
%ffmpeg(format="ogg", %audio(codec="libvorbis", samplerate=48000, b="256k", channels=2)),
|
||||
host="127.0.0.1",
|
||||
port=265,
|
||||
password="${outputs.secrets.castSourcePass}",
|
||||
public=true,
|
||||
icy_metadata=["artist", "title"],
|
||||
mount="jimbops.opus",
|
||||
encoding = "UTF-8",
|
||||
jimbops_fallback
|
||||
)
|
||||
'';
|
||||
in {
|
||||
JimBops = pkgs.writeText "liquidjim" jimbops;
|
||||
};
|
||||
|
||||
# The web frontend
|
||||
nginx.virtualHosts."icecast.${outputs.secrets.jimDomain}" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:265";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
add_header Ice-Public "1";
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue