2023-10-27 16:44:17 +01:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
hostPath,
|
|
|
|
tree,
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2023-10-27 17:44:32 +01:00
|
|
|
containerName = "owncast";
|
2023-10-27 16:44:17 +01:00
|
|
|
|
|
|
|
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
|
|
|
|
|
|
|
|
hostIP = containerAddresses.host;
|
|
|
|
containerIP = containerAddresses.containers.${containerName};
|
|
|
|
in {
|
2023-10-27 17:44:32 +01:00
|
|
|
containers.owncast = {
|
2023-10-27 16:44:17 +01:00
|
|
|
autoStart = true;
|
|
|
|
privateNetwork = true;
|
|
|
|
hostAddress = hostIP;
|
|
|
|
localAddress = containerIP;
|
|
|
|
|
|
|
|
specialArgs = {
|
|
|
|
inherit inputs;
|
|
|
|
inherit tree;
|
|
|
|
inherit self;
|
|
|
|
inherit hostPath;
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {...}: {
|
|
|
|
nixpkgs.pkgs = pkgs;
|
|
|
|
|
|
|
|
imports = with tree;
|
|
|
|
[
|
|
|
|
presets.nixos.containerBase
|
2023-10-27 17:44:32 +01:00
|
|
|
./secrets.nix
|
2023-10-27 16:44:17 +01:00
|
|
|
]
|
2023-10-27 17:44:32 +01:00
|
|
|
++ (with hosts.hetzner-arm.containers.owncast.profiles; [
|
2023-10-27 16:44:17 +01:00
|
|
|
owncast
|
2023-10-27 17:44:32 +01:00
|
|
|
restic
|
2023-10-27 16:44:17 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
1935
|
|
|
|
8080
|
|
|
|
];
|
|
|
|
|
2024-05-25 21:10:26 +01:00
|
|
|
home-manager.users.root.home.stateVersion = "24.05";
|
|
|
|
system.stateVersion = "24.05";
|
2023-10-27 16:44:17 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."stream.owo.monster" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://${containerIP}:8080";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
nat.forwardPorts = [
|
|
|
|
{
|
|
|
|
sourcePort = 1935;
|
|
|
|
destination = "${containerIP}\:1935";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
firewall.allowedTCPPorts = [
|
|
|
|
1935
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|