melodypond/melodies.nix

27 lines
651 B
Nix
Raw Normal View History

2023-09-24 20:16:02 +00:00
{pkgs, config, ...}:
{
services.nginx.enable = true;
2023-09-29 20:21:32 +00:00
2023-09-24 20:16:02 +00:00
services.nginx.virtualHosts."${config.networking.hostName}" = {
2023-09-29 20:21:32 +00:00
addSSL = true;
sslCertificate = "/etc/ssl/snakeoil.crt";
sslCertificateKey = "/etc/ssl/snakeoil.key";
2023-09-24 20:16:02 +00:00
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"
];
}