{ lib, config, ... }:
let
cfg = config.services.icecast;
in {
options.services.icecast = {
mount = lib.mkOption {
type = lib.types.str;
example = "stream.mp3";
};
};
config = lib.mkIf cfg.enable {
services.icecast = {
listen.address = "127.0.0.1";
admin.password = "hackme";
extraConf = ''
hackme
/${cfg.mount}
20
65536
false
false
'';
};
services.nginx.virtualHosts.${cfg.hostname} = {
enableACME = true;
forceSSL = true;
locations."/${cfg.mount}" = {
proxyPass = "http://localhost:${toString cfg.listen.port}/${cfg.mount}";
};
};
};
}