melodypond/melodies.nix
2023-09-30 09:34:22 -04:00

27 lines
651 B
Nix

{pkgs, config, ...}:
{
services.nginx.enable = true;
services.nginx.virtualHosts."${config.networking.hostName}" = {
addSSL = true;
sslCertificate = "/etc/ssl/snakeoil.crt";
sslCertificateKey = "/etc/ssl/snakeoil.key";
root = pkgs.mmelodies.frontend;
locations."/hls/" = {
alias = "/var/cache/hls/";
extraConfig = ''
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
'';
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
systemd.tmpfiles.rules = [
"d /dev/shm/hls 0755 appuser users 12h -"
"L /var/cache/hls - - - - /dev/shm/hls"
];
}