mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
feat: owncast test
This commit is contained in:
parent
748133dbd9
commit
eeb0e890b8
5 changed files with 78 additions and 4 deletions
|
@ -21,6 +21,7 @@
|
||||||
"nextcloud"
|
"nextcloud"
|
||||||
"nginx"
|
"nginx"
|
||||||
"ollama"
|
"ollama"
|
||||||
|
"owncast"
|
||||||
"peertube"
|
"peertube"
|
||||||
"postgresql"
|
"postgresql"
|
||||||
"samba"
|
"samba"
|
||||||
|
|
|
@ -9,6 +9,7 @@ let
|
||||||
minecraftLabel = "Minecraft";
|
minecraftLabel = "Minecraft";
|
||||||
nextcloudLabel = "Nextcloud";
|
nextcloudLabel = "Nextcloud";
|
||||||
ollamaLabel = "Ollama";
|
ollamaLabel = "Ollama";
|
||||||
|
owncastLabel = "Owncast";
|
||||||
peertubeLabel = "PeerTube";
|
peertubeLabel = "PeerTube";
|
||||||
postgresLabel = "PostgreSQL";
|
postgresLabel = "PostgreSQL";
|
||||||
sambaLabel = "Samba";
|
sambaLabel = "Samba";
|
||||||
|
@ -27,6 +28,7 @@ let
|
||||||
minecraftName = "minecraft";
|
minecraftName = "minecraft";
|
||||||
nextcloudName = "nextcloud";
|
nextcloudName = "nextcloud";
|
||||||
ollamaName = "ollama";
|
ollamaName = "ollama";
|
||||||
|
owncastName = "owncast";
|
||||||
peertubeName = "peertube";
|
peertubeName = "peertube";
|
||||||
postgresName = "postgres";
|
postgresName = "postgres";
|
||||||
sambaName = "samba";
|
sambaName = "samba";
|
||||||
|
@ -217,6 +219,28 @@ in {
|
||||||
key = "${sslPath}/${ollamaName}.${domain0}/key.pem";
|
key = "${sslPath}/${ollamaName}.${domain0}/key.pem";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
owncast = let
|
||||||
|
owncastSubdomain = "stream";
|
||||||
|
in {
|
||||||
|
label = owncastLabel;
|
||||||
|
name = owncastName;
|
||||||
|
sops = {
|
||||||
|
path0 = "${sops}/${owncastName}";
|
||||||
|
};
|
||||||
|
subdomain = owncastSubdomain;
|
||||||
|
paths = {
|
||||||
|
path0 = "${servicePath}/${owncastLabel}";
|
||||||
|
path1 = "/mnt/media/storage/${owncastName}";
|
||||||
|
};
|
||||||
|
ports = {
|
||||||
|
port0 = 9454;
|
||||||
|
port1 = 1935;
|
||||||
|
};
|
||||||
|
ssl = {
|
||||||
|
cert = "${sslPath}/${owncastSubdomain}.${domain1}/fullchain.pem";
|
||||||
|
key = "${sslPath}/${owncastSubdomain}.${domain1}/key.pem";
|
||||||
|
};
|
||||||
|
};
|
||||||
peertube = {
|
peertube = {
|
||||||
label = peertubeLabel;
|
label = peertubeLabel;
|
||||||
name = peertubeName;
|
name = peertubeName;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
instanceName = service: (instance.${service}.subdomain);
|
instanceName = service: (instance.${service}.subdomain);
|
||||||
|
|
||||||
domain0ServiceNames = [
|
domain0SubdomainNames = [
|
||||||
"nextcloud"
|
"nextcloud"
|
||||||
"jellyfin"
|
"jellyfin"
|
||||||
"minecraft"
|
"minecraft"
|
||||||
|
@ -24,17 +24,18 @@
|
||||||
"vaultwarden"
|
"vaultwarden"
|
||||||
];
|
];
|
||||||
|
|
||||||
domain1ServiceNames = [
|
domain1SubdomainNames = [
|
||||||
"nextcloud"
|
"nextcloud"
|
||||||
"castopod"
|
"castopod"
|
||||||
"forgejo"
|
"forgejo"
|
||||||
"matrix"
|
"matrix"
|
||||||
|
"owncast"
|
||||||
"peertube"
|
"peertube"
|
||||||
"writefreely"
|
"writefreely"
|
||||||
];
|
];
|
||||||
|
|
||||||
domain0Subdomains = map instanceName domain0ServiceNames;
|
domain0Subdomains = map instanceName domain0SubdomainNames;
|
||||||
domain1Subdomains = map instanceName domain1ServiceNames;
|
domain1Subdomains = map instanceName domain1SubdomainNames;
|
||||||
|
|
||||||
domainRoot = [
|
domainRoot = [
|
||||||
domain.url0
|
domain.url0
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
./ollama.nix
|
./ollama.nix
|
||||||
./peertube.nix
|
./peertube.nix
|
||||||
./postgresql.nix
|
./postgresql.nix
|
||||||
|
./owncast.nix
|
||||||
./samba.nix
|
./samba.nix
|
||||||
./vaultwarden.nix
|
./vaultwarden.nix
|
||||||
|
|
||||||
|
|
47
nixos/modules/services/owncast.nix
Normal file
47
nixos/modules/services/owncast.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue