2023-09-21 05:06:27 +01:00
|
|
|
{
|
|
|
|
self,
|
|
|
|
hostPath,
|
|
|
|
tree,
|
|
|
|
inputs,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
|
|
|
|
hostIP = containerAddresses.host;
|
|
|
|
containerIP = containerAddresses.containers.social;
|
|
|
|
in {
|
|
|
|
containers.social = {
|
|
|
|
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
|
|
|
|
./secrets.nix
|
|
|
|
]
|
|
|
|
++ (with hosts.hetzner-arm.containers.social.profiles; [
|
|
|
|
gotosocial
|
2024-01-25 13:41:33 +00:00
|
|
|
restic
|
2023-09-21 05:06:27 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
networking.firewall = {
|
|
|
|
enable = true;
|
|
|
|
allowedTCPPorts = [8080];
|
|
|
|
};
|
|
|
|
|
2024-05-25 21:10:26 +01:00
|
|
|
home-manager.users.root.home.stateVersion = "24.05";
|
|
|
|
system.stateVersion = "24.05";
|
2023-09-21 05:06:27 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-25 13:41:33 +00:00
|
|
|
services.nginx.virtualHosts."gts-02.owo.monster" = {
|
2023-09-21 05:06:27 +01:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://${containerIP}:8080";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
extraConfig = ''
|
|
|
|
# uncomment if running nginx without recommendedProxySettings
|
|
|
|
# proxy_set_header Host $host;
|
|
|
|
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
# proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
extraConfig = ''
|
|
|
|
client_max_body_size 128M;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|