{ pkgs, config, ... }:
{
  imports = [
    ./nginx
    ./liquidsoap
  ];

  services.icecast = {
    enable = config.system.server.enable;
    listen.port = 73;
    hostname = "radio.${config.domains.p2}";
    admin = {
      user = "${config.sysusers.main}";
      password = "${config.secrets.castAdminPass}";
    };
    extraConf = ''
      <authentication>
        <source-password>${config.secrets.castSourcePass}</source-password>
      </authentication>
      
      <location>Canada</location>
      <admin>contact@${config.domains.p2}</admin>
    '';
  };
}
