nixos-config/nixos/system/desktop/icecast.nix

62 lines
1.7 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
# --------------------------------------------------
# How to use?
# * start the icecast
# * connect via mixxx to it.
# * add the podcast to mpd in the same network
# --------------------------------------------------
{ pkgs, config, lib, ... }:
let
user = "username";
password = "password";
mountPoint = "/radio.mp3";
maxListeners = 20;
2021-11-01 09:20:42 +01:00
in
{
2019-10-24 02:20:38 +02:00
services.icecast = {
enable = true;
hostname = config.networking.hostName;
admin = {
user = "palo";
password = "palo";
};
# http://icecast.org/docs/icecast-2.4.1/config-file.html
extraConf = ''
<mount type="normal">
<mount-name>${mountPoint}</mount-name>
<username>${user}</username>
<password>${password}</password>
<max-listeners>${toString maxListeners}</max-listeners>
<max-listener-duration>3600</max-listener-duration>
<charset>UTF8</charset>
<public>1</public>
<stream-name>Palos Awesome Stream</stream-name>
<stream-description>Kick ass Tracks</stream-description>
<stream-url>https://ingolf-wagner.de</stream-url>
<genre>classical</genre>
<bitrate>320</bitrate>
<type>application/ogg</type>
<subtype>vorbis</subtype>
<hidden>1</hidden>
<burst-size>65536</burst-size>
<mp3-metadata-interval>4096</mp3-metadata-interval>
</mount>
'';
};
# use port which I can see in iptable -L -v -n
networking.firewall = {
allowedTCPPorts = [ config.services.icecast.listen.port ];
allowedUDPPorts = [ config.services.icecast.listen.port ];
};
# don't want to have the service running all the time
# ---------------------------------------------------
2019-12-20 05:54:26 +01:00
systemd.services.icecast.wantedBy = lib.mkForce [ ];
systemd.services.icecast.after = lib.mkForce [ ];
2019-10-24 02:20:38 +02:00
}