nix-config/hosts/owncast/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.3 KiB
Nix
Raw Normal View History

2022-12-12 21:20:41 +01:00
{ config, pkgs, ... }:
2022-11-21 19:39:38 +01:00
{
2022-12-12 21:57:00 +01:00
imports = [
./owncast-archiver.nix
];
2022-11-21 19:39:38 +01:00
deployment = {
2022-11-21 21:56:21 +01:00
vcpu = 8;
2022-11-21 21:49:06 +01:00
mem = 2048;
2022-12-12 21:15:04 +01:00
persistedShares = [ "/etc" "/home" "/var" ];
extraShares = [ {
source = "/glusterfs/big/microvms/c3d2/config/owncast/archive";
2022-12-12 21:57:00 +01:00
mountPoint = config.services.owncast-archiver.targetDir;
2022-12-12 21:15:04 +01:00
} ];
2022-11-21 19:39:38 +01:00
};
c3d2.hq.statistics.enable = true;
networking = {
hostName = "owncast";
firewall.allowedTCPPorts = [ 80 443 ];
};
services.owncast = {
enable = true;
openFirewall = true;
};
services.nginx = {
enable = true;
recommendedOptimisation = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
2022-12-12 21:20:41 +01:00
additionalModules = [ pkgs.nginxModules.fancyindex ];
2022-11-21 19:39:38 +01:00
virtualHosts."owncast.c3d2.de" = {
default = true;
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.owncast.port}";
proxyWebsockets = true;
};
locations."/archive/" = {
2022-12-12 21:57:00 +01:00
alias = "${config.services.owncast-archiver.targetDir}/";
2022-12-12 21:15:04 +01:00
extraConfig = ''
fancyindex on;
fancyindex_exact_size off;
'';
};
2022-11-21 19:39:38 +01:00
};
};
2022-12-12 21:57:00 +01:00
systemd.services.nginx.serviceConfig.ReadWritePaths = [
config.services.owncast-archiver.targetDir
];
services.owncast-archiver.enable = true;
2022-11-21 19:39:38 +01:00
}