1
0
Fork 0
dotfiles/system/nixos/home-proxy.nix

18 lines
452 B
Nix
Raw Normal View History

2023-04-08 22:37:43 +00:00
{ pkgs, config, secret, ... }:
{
services.nginx.streamConfig = ''
upstream home {
resolver 1.1.1.1 ipv6=off;
2023-04-08 22:40:08 +00:00
server ${secret.nginx.upstream.home.hostname}:${builtins.toString(secret.nginx.upstream.home.port)};
2023-04-08 22:37:43 +00:00
}
server {
2023-04-08 22:40:08 +00:00
listen ${builtins.toString(secret.nginx.upstream.home.port)};
2023-04-08 22:37:43 +00:00
proxy_pass home;
}
'';
networking.firewall.interfaces."enp1s0".allowedTCPPorts = [ secret.nginx.upstream.home.port ];
}