nixos/sing-box: bypass lan

This commit is contained in:
Guanran Wang 2024-08-24 21:11:27 +08:00
parent 89a91fdd0c
commit 1df7471bf7

View file

@ -39,10 +39,21 @@
route = { route = {
rules = [ rules = [
{ {
rule_set = ["geoip-cn" "geosite-cn"]; rule_set = [
"geoip-cn"
"geosite-cn"
];
outbound = "direct";
}
{
rule_set = [
"geosite-private"
];
ip_is_private = true;
outbound = "direct"; outbound = "direct";
} }
]; ];
rule_set = [ rule_set = [
{ {
tag = "geoip-cn"; tag = "geoip-cn";
@ -56,7 +67,14 @@
format = "binary"; format = "binary";
path = "${pkgs.sing-geosite}/share/sing-box/rule-set/geosite-cn.srs"; path = "${pkgs.sing-geosite}/share/sing-box/rule-set/geosite-cn.srs";
} }
{
tag = "geosite-private";
type = "local";
format = "binary";
path = "${pkgs.sing-geosite}/share/sing-box/rule-set/geosite-private.srs";
}
]; ];
final = "tyo0"; final = "tyo0";
}; };
@ -75,6 +93,7 @@
httpProxy = "http://127.0.0.1:1080/"; httpProxy = "http://127.0.0.1:1080/";
httpsProxy = "http://127.0.0.1:1080/"; httpsProxy = "http://127.0.0.1:1080/";
}; };
environment.shellAliases = let environment.shellAliases = let
inherit (config.networking.proxy) httpProxy httpsProxy; inherit (config.networking.proxy) httpProxy httpsProxy;
in { in {