2023-08-21 21:22:26 -05:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
|
let
|
|
|
|
|
lan = "enp1s0";
|
|
|
|
|
wan = "enp2s0";
|
|
|
|
|
iot = "vlan66";
|
|
|
|
|
in {
|
2023-06-29 00:27:30 -05:00
|
|
|
greg.tailscale.enable = true;
|
|
|
|
|
|
2023-08-21 21:22:26 -05:00
|
|
|
# Really, why do I still have to force-disable this crap?
|
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
|
"net.ipv6.conf.${lan}.disable_ipv6" = true;
|
|
|
|
|
"net.ipv6.conf.${wan}.disable_ipv6" = true;
|
|
|
|
|
"net.ipv6.conf.${iot}.disable_ipv6" = true;
|
|
|
|
|
"net.ipv6.conf.lo.disable_ipv6" = true;
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-29 00:27:30 -05:00
|
|
|
networking = {
|
2023-08-18 20:46:37 -05:00
|
|
|
enableIPv6 = false;
|
2023-08-21 21:22:26 -05:00
|
|
|
networkmanager.enable = pkgs.lib.mkForce false;
|
2023-08-18 20:46:37 -05:00
|
|
|
#defaultGateway = "10.42.1.1";
|
2023-06-29 00:27:30 -05:00
|
|
|
# 100.100.100.100 is the tailscale DNS
|
2023-08-18 20:46:37 -05:00
|
|
|
nameservers = [
|
|
|
|
|
"1.1.1.1"
|
|
|
|
|
#"100.100.100.100"
|
|
|
|
|
"127.0.0.1"
|
|
|
|
|
];
|
2023-06-29 00:27:30 -05:00
|
|
|
interfaces = {
|
2023-08-18 20:46:37 -05:00
|
|
|
# This is our WAN port
|
2023-08-21 21:22:26 -05:00
|
|
|
"${wan}" = {
|
2023-08-18 20:46:37 -05:00
|
|
|
useDHCP = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# This is our LAN port
|
2023-08-21 21:22:26 -05:00
|
|
|
"${lan}" = {
|
|
|
|
|
ipv4.addresses = [ {
|
|
|
|
|
address = "10.42.1.1";
|
|
|
|
|
prefixLength = 16;
|
|
|
|
|
} ];
|
|
|
|
|
useDHCP = false;
|
|
|
|
|
};
|
2023-08-18 20:46:37 -05:00
|
|
|
wlan0.useDHCP = false;
|
2023-06-29 00:27:30 -05:00
|
|
|
|
2023-08-21 21:22:26 -05:00
|
|
|
"${iot}" = {
|
|
|
|
|
useDHCP = false;
|
|
|
|
|
ipv4.addresses = [ {
|
2023-08-22 00:40:32 -05:00
|
|
|
address = "192.168.66.1";
|
2023-08-21 21:22:26 -05:00
|
|
|
prefixLength = 24;
|
|
|
|
|
} ];
|
|
|
|
|
};
|
2023-06-29 00:27:30 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
vlans = {
|
2023-08-21 21:22:26 -05:00
|
|
|
"${iot}" = {
|
2023-06-29 00:27:30 -05:00
|
|
|
id = 66;
|
2023-08-21 21:22:26 -05:00
|
|
|
interface = lan;
|
2023-06-29 00:27:30 -05:00
|
|
|
};
|
|
|
|
|
};
|
2023-08-21 21:22:26 -05:00
|
|
|
|
|
|
|
|
firewall.enable = false;
|
|
|
|
|
# Router portion here
|
|
|
|
|
nftables = let
|
|
|
|
|
myvars = {
|
|
|
|
|
lanInterfaces = [ lan ];
|
|
|
|
|
wanInterface = wan;
|
|
|
|
|
limitedLan = [ iot ];
|
|
|
|
|
tcpPorts = config.networking.firewall.allowedTCPPorts;
|
|
|
|
|
udpPorts = config.networking.firewall.allowedUDPPorts;
|
|
|
|
|
};
|
|
|
|
|
in {
|
|
|
|
|
enable = true;
|
|
|
|
|
rulesetFile = pkgs.template "router.nft" myvars ./nftables.nft;
|
|
|
|
|
};
|
2023-06-29 00:27:30 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileSystems."/media" = {
|
|
|
|
|
device = "10.42.1.4:/volume1/video/";
|
|
|
|
|
fsType = "nfs";
|
|
|
|
|
options = [ "ro" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.jellyfin = {
|
|
|
|
|
enable = true;
|
|
|
|
|
openFirewall = true;
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-18 20:46:37 -05:00
|
|
|
greg.proxies = {
|
|
|
|
|
"jellyfin.thehellings.lan".target = "http://localhost:8096";
|
2023-08-22 00:40:32 -05:00
|
|
|
"jellyfin.shire-zebra.ts.net" = {
|
|
|
|
|
target = "http://localhost:8096";
|
|
|
|
|
genAliases = false;
|
|
|
|
|
};
|
2023-08-18 20:46:37 -05:00
|
|
|
};
|
2023-06-29 00:27:30 -05:00
|
|
|
|
|
|
|
|
#########
|
|
|
|
|
# Blind service proxy behind the walls of the VPN
|
|
|
|
|
########
|
|
|
|
|
services._3proxy = {
|
|
|
|
|
enable = true;
|
|
|
|
|
services = [ {
|
|
|
|
|
type = "socks";
|
|
|
|
|
auth = [ "strong" ];
|
|
|
|
|
bindPort = 3128;
|
|
|
|
|
acl = [ {
|
|
|
|
|
rule = "allow";
|
|
|
|
|
users = [ "greg" ];
|
|
|
|
|
} ];
|
|
|
|
|
} ];
|
2023-08-18 20:46:37 -05:00
|
|
|
#usersFile = "/run/agenix/3proxy";
|
2023-06-29 00:27:30 -05:00
|
|
|
denyPrivate = false;
|
|
|
|
|
};
|
2023-08-18 20:46:37 -05:00
|
|
|
#age.secrets."3proxy" = {
|
|
|
|
|
# file = ../../secrets/3proxy.age;
|
|
|
|
|
# mode = "776";
|
|
|
|
|
#};
|
2023-06-29 00:27:30 -05:00
|
|
|
networking.firewall.allowedTCPPorts = [ 3128 ];
|
|
|
|
|
}
|