formatting

This commit is contained in:
FUFSoB committed 2026-04-19 12:11:01 +05:00
1 parent 744a769e73
commit 4d6802e194
21 files changed
+843 -582

No files matched your search

+13 -6
View File
@@ -55,7 +55,9 @@ let
zapretUserIps = if syncZapretDirectUserIps then zapretCfg.ipsetAll else [ ];
zapretCustomDomains =
if syncZapretDirectDomains then
lib.unique (lib.concatMap (rule: lib.optionals rule.enableDirectSync rule.domains) zapretCfg.hostlistRules)
lib.unique (
lib.concatMap (rule: lib.optionals rule.enableDirectSync rule.domains) zapretCfg.hostlistRules
)
else
[ ];
zapretExcludedDomains =
@@ -90,17 +92,22 @@ let
geoips = lib.unique (r.direct.geoips ++ lib.optional r.enableRuDirect "ru");
};
mkRule = field: tag: items:
lib.optional (items != [ ]) { ${field} = items; outbound = tag; };
mkDomainRule = mkRule "domain_suffix";
mkIPRule = mkRule "ip_cidr";
mkRule =
field: tag: items:
lib.optional (items != [ ]) {
${field} = items;
outbound = tag;
};
mkDomainRule = mkRule "domain_suffix";
mkIPRule = mkRule "ip_cidr";
mkRulesetRule = mkRule "rule_set";
# In "first" mode the start script renames the first outbound to "proxy",
# so any per-outbound routing tag that isn't direct/block/proxy must map
# to "proxy" instead of the original tag (which won't exist in sing-box).
resolveTag =
tag: if derived.collapseNamedOutbounds && !builtins.elem tag derived.builtinTags then "proxy" else tag;
tag:
if derived.collapseNamedOutbounds && !builtins.elem tag derived.builtinTags then "proxy" else tag;
# Collect per-outbound routing attached directly to outbound definitions.
perOutboundRules = lib.concatMap (