feat: owncast test

This commit is contained in:
Nick 2024-10-18 22:05:40 -05:00
parent 748133dbd9
commit eeb0e890b8
5 changed files with 78 additions and 4 deletions

View file

@ -15,7 +15,7 @@
instanceName = service: (instance.${service}.subdomain);
domain0ServiceNames = [
domain0SubdomainNames = [
"nextcloud"
"jellyfin"
"minecraft"
@ -24,17 +24,18 @@
"vaultwarden"
];
domain1ServiceNames = [
domain1SubdomainNames = [
"nextcloud"
"castopod"
"forgejo"
"matrix"
"owncast"
"peertube"
"writefreely"
];
domain0Subdomains = map instanceName domain0ServiceNames;
domain1Subdomains = map instanceName domain1ServiceNames;
domain0Subdomains = map instanceName domain0SubdomainNames;
domain1Subdomains = map instanceName domain1SubdomainNames;
domainRoot = [
domain.url0

View file

@ -11,6 +11,7 @@
./ollama.nix
./peertube.nix
./postgresql.nix
./owncast.nix
./samba.nix
./vaultwarden.nix

View file

@ -0,0 +1,47 @@
{flake, ...}: let
inherit (flake.config.people) user0;
inherit (flake.config.people.${user0}) domain;
inherit (flake.config.system.device) server wildcard;
inherit (flake.config.service.instance.owncast) paths ports subdomain ssl name;
localhost = wildcard.ip.address0;
host = "${subdomain}.${domain.url1}";
in {
services = {
owncast = {
enable = true;
listen = localhost;
port = ports.port0;
openFirewall = true;
};
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
reverse_proxy ${localhost}:${toString ports.port0}
tls ${ssl.cert} ${ssl.key}
'';
};
};
};
};
fileSystems."/var/lib/${name}" = {
device = paths.path0;
fsType = "none";
options = ["bind"];
depends = [server.storage0.mount];
};
systemd.tmpfiles.rules = [
"Z ${paths.path0} 755 ${name} ${name} -"
];
networking = {
firewall = {
allowedTCPPorts = [
ports.port0
ports.port1
];
};
};
}