2023-06-09 20:54:03 +08:00
|
|
|
inputs:
|
|
|
|
{
|
|
|
|
config =
|
|
|
|
{
|
|
|
|
services =
|
|
|
|
{
|
|
|
|
dnsmasq =
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
settings =
|
|
|
|
{
|
|
|
|
no-poll = true;
|
|
|
|
server = [ "127.0.0.1#10853" ];
|
2023-07-22 19:41:54 +08:00
|
|
|
listen-address = [ "127.0.0.1" "172.17.0.1" ];
|
2023-06-09 20:54:03 +08:00
|
|
|
bind-interfaces = true;
|
|
|
|
ipset =
|
|
|
|
[
|
|
|
|
"/developer.download.nvidia.com/noproxy_net"
|
|
|
|
"/yuanshen.com/noproxy_net"
|
|
|
|
"/zoom.us/noproxy_net"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
xray = { enable = true; settingsFile = inputs.config.sops.secrets."xray.json".path; };
|
|
|
|
v2ray-forwarder = { enable = true; proxyPort = 10880; xmuPort = 10881; };
|
|
|
|
};
|
|
|
|
sops.secrets."xray.json" =
|
|
|
|
{ mode = "0440"; owner = "v2ray"; group = "v2ray"; restartUnits = [ "xray.service" ]; };
|
|
|
|
systemd.services.xray.serviceConfig =
|
|
|
|
{
|
|
|
|
DynamicUser = inputs.lib.mkForce false;
|
|
|
|
User = "v2ray";
|
|
|
|
Group = "v2ray";
|
|
|
|
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
|
|
|
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
2023-06-21 11:02:31 +08:00
|
|
|
LimitNPROC = 10000;
|
|
|
|
LimitNOFILE = 1000000;
|
2023-06-09 20:54:03 +08:00
|
|
|
};
|
|
|
|
users = { users.v2ray = { isSystemUser = true; group = "v2ray"; }; groups.v2ray = {}; };
|
|
|
|
boot.kernel.sysctl =
|
|
|
|
{
|
|
|
|
"net.ipv4.conf.all.route_localnet" = true;
|
|
|
|
"net.ipv4.conf.default.route_localnet" = true;
|
|
|
|
"net.ipv4.conf.all.accept_local" = true;
|
|
|
|
"net.ipv4.conf.default.accept_local" = true;
|
|
|
|
"net.ipv4.ip_forward" = true;
|
|
|
|
"net.ipv4.ip_nonlocal_bind" = true;
|
2023-06-18 00:41:29 +08:00
|
|
|
"net.bridge.bridge-nf-call-iptables" = false;
|
|
|
|
"net.bridge.bridge-nf-call-ip6tables" = false;
|
|
|
|
"net.bridge.bridge-nf-call-arptables" = false;
|
2023-06-09 20:54:03 +08:00
|
|
|
};
|
|
|
|
environment.etc."resolv.conf".text = "nameserver 127.0.0.1";
|
2023-06-19 20:50:37 +08:00
|
|
|
networking.firewall.trustedInterfaces = [ "docker0" "virbr0" ];
|
2023-06-09 20:54:03 +08:00
|
|
|
};
|
|
|
|
}
|