nixfiles/hosts/hetzner-arm/containers/owncast/default.nix

75 lines
1.4 KiB
Nix
Raw Normal View History

{
self,
hostPath,
tree,
inputs,
pkgs,
config,
...
}: let
2023-10-27 17:44:32 +01:00
containerName = "owncast";
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
hostIP = containerAddresses.host;
containerIP = containerAddresses.containers.${containerName};
in {
2023-10-27 17:44:32 +01:00
containers.owncast = {
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 17:44:32 +01:00
++ (with hosts.hetzner-arm.containers.owncast.profiles; [
owncast
2023-10-27 17:44:32 +01:00
restic
]);
networking.firewall.allowedTCPPorts = [
1935
8080
];
home-manager.users.root.home.stateVersion = "24.05";
system.stateVersion = "24.05";
};
};
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
];
};
}