nixos-config/modules/system/services/server/icecast/liquidsoap/nixbops/default.nix

39 lines
1.2 KiB
Nix
Raw Normal View History

2025-02-25 01:37:56 -05:00
{ config, lib, pkgs, ... }:
{
2025-01-01 16:54:27 -05:00
config = lib.mkIf config.services.icecast.enable {
services.liquidsoap.streams = {
2025-03-03 01:36:06 -05:00
nixbops = pkgs.writeText "nixbops" ''
2025-01-01 16:54:27 -05:00
settings.log.stdout.set(true)
settings.init.allow_root.set(true)
settings.scheduler.fast_queues.set(2)
2025-03-08 02:44:09 -05:00
stream = mksafe(playlist(mode='randomize', reload=1, reload_mode="rounds", "/storage/Music/NixBops"))
2025-02-25 03:44:13 -05:00
stream_fallback = fallback([stream, stream])
2025-01-01 16:54:27 -05:00
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},
password="${config.secrets.cast.sourcePass}",
2025-01-01 16:54:27 -05:00
encoding = "UTF-8",
2025-03-03 01:36:06 -05:00
name="NixBops Radio",
2025-01-01 16:54:27 -05:00
genre="Anything",
2025-03-03 01:36:06 -05:00
description="Random collection of downloaded music.",
mount="nixbops.opus",
2025-01-01 16:54:27 -05:00
icy_metadata=["artist", "title"],
public=true,
2025-02-25 03:44:13 -05:00
stream_fallback
2025-01-01 16:54:27 -05:00
)
'';
};
# Avoid the most stupid error imaginable
2025-03-03 01:36:06 -05:00
systemd.services.nixbops = {
2025-01-01 16:54:27 -05:00
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
};
2024-12-22 22:02:10 -05:00
};
}