remove all grammars and fix pkgs with new setup
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
{ config, lib, pkgs, stable_pkgs, unstable_pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
let
|
lib,
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
stable_pkgs,
|
||||||
|
unstable_pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
vpsip4 = "100.100.1.10";
|
vpsip4 = "100.100.1.10";
|
||||||
homelabipv4 = "10.10.0.10";
|
homelabipv4 = "10.10.0.10";
|
||||||
homelab = config.homelab;
|
homelab = config.homelab;
|
||||||
in
|
in {
|
||||||
{
|
imports = [
|
||||||
imports =
|
|
||||||
[
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../nixos
|
../../nixos
|
||||||
../../../users/blake
|
../../../users/blake
|
||||||
@@ -73,39 +77,39 @@ in
|
|||||||
nat = {
|
nat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
externalInterface = "eth0"; # your PUBLIC_IF
|
externalInterface = "eth0"; # your PUBLIC_IF
|
||||||
internalInterfaces = [ "tailscale0" ];
|
internalInterfaces = ["tailscale0"];
|
||||||
# maybe one day i will figure out the forward ports proper
|
# maybe one day i will figure out the forward ports proper
|
||||||
forwardPorts = [
|
forwardPorts = [
|
||||||
# { sourcePort = 80; destination = "10.10.0.10:80"; proto = "tcp"; } # http
|
# { sourcePort = 80; destination = "10.10.0.10:80"; proto = "tcp"; } # http
|
||||||
# { sourcePort = 443; destination = "10.10.0.10:443"; proto = "tcp"; } # https
|
# { sourcePort = 443; destination = "10.10.0.10:443"; proto = "tcp"; } # https
|
||||||
# { sourcePort = 25777; destination = "10.10.0.10:25777"; proto = "tcp"; } # minecraft
|
# { sourcePort = 25777; destination = "10.10.0.10:25777"; proto = "tcp"; } # minecraft
|
||||||
# { sourcePort = 25777; destination = "10.10.0.10:25777"; proto = "udp"; } # minecraft
|
# { sourcePort = 25777; destination = "10.10.0.10:25777"; proto = "udp"; } # minecraft
|
||||||
# { sourcePort = 7567; destination = "10.10.0.10:7567"; proto = "tcp"; } # git
|
# { sourcePort = 7567; destination = "10.10.0.10:7567"; proto = "tcp"; } # git
|
||||||
|
|
||||||
# Rustdesk ports
|
# Rustdesk ports
|
||||||
# { sourcePort = 21115; destination = "10.10.0.10:21115"; proto = "tcp"; }
|
# { sourcePort = 21115; destination = "10.10.0.10:21115"; proto = "tcp"; }
|
||||||
# { sourcePort = 21116; destination = "10.10.0.10:21116"; proto = "tcp"; }
|
# { sourcePort = 21116; destination = "10.10.0.10:21116"; proto = "tcp"; }
|
||||||
# { sourcePort = 21116; destination = "10.10.0.10:21116"; proto = "udp"; }
|
# { sourcePort = 21116; destination = "10.10.0.10:21116"; proto = "udp"; }
|
||||||
# { sourcePort = 21118; destination = "10.10.0.10:21118"; proto = "tcp"; }
|
# { sourcePort = 21118; destination = "10.10.0.10:21118"; proto = "tcp"; }
|
||||||
# { sourcePort = 21117; destination = "10.10.0.10:21117"; proto = "tcp"; }
|
# { sourcePort = 21117; destination = "10.10.0.10:21117"; proto = "tcp"; }
|
||||||
# { sourcePort = 21119; destination = "10.10.0.10:21119"; proto = "tcp"; }
|
# { sourcePort = 21119; destination = "10.10.0.10:21119"; proto = "tcp"; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# what actually does the forwarding
|
# what actually does the forwarding
|
||||||
firewall = {
|
firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [ 22 80 443 25777 7567 21115 21116 21117 21118 21119 ];
|
allowedTCPPorts = [22 80 443 25777 7567 21115 21116 21117 21118 21119];
|
||||||
# tailscale will also need its UDP port open:
|
# tailscale will also need its UDP port open:
|
||||||
allowedUDPPorts = [ config.services.tailscale.port 25777 21116 ];
|
allowedUDPPorts = [config.services.tailscale.port 25777 21116];
|
||||||
trustedInterfaces = [ "tailscale0" ];
|
trustedInterfaces = ["tailscale0"];
|
||||||
/*
|
/*
|
||||||
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination ${homelabipv4}:80 # http
|
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination ${homelabipv4}:80 # http
|
||||||
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination ${homelabipv4}:443 # https
|
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination ${homelabipv4}:443 # https
|
||||||
|
|
||||||
iptables -t nat -A POSTROUTING -o tailscale0 -p tcp --dport 80 -d ${homelabipv4}/32 -j SNAT --to-source ${vpsip4} # http
|
iptables -t nat -A POSTROUTING -o tailscale0 -p tcp --dport 80 -d ${homelabipv4}/32 -j SNAT --to-source ${vpsip4} # http
|
||||||
iptables -t nat -A POSTROUTING -o tailscale0 -p tcp --dport 443 -d ${homelabipv4}/32 -j SNAT --to-source ${vpsip4} # https
|
iptables -t nat -A POSTROUTING -o tailscale0 -p tcp --dport 443 -d ${homelabipv4}/32 -j SNAT --to-source ${vpsip4} # https
|
||||||
*/
|
*/
|
||||||
extraCommands = ''
|
extraCommands = ''
|
||||||
# Clear any previous rules if you are iterating
|
# Clear any previous rules if you are iterating
|
||||||
iptables -t nat -F
|
iptables -t nat -F
|
||||||
@@ -163,7 +167,4 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "25.05"; # Did you read the comment?
|
system.stateVersion = "25.05"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user