chore: collapse packages
This commit is contained in:
29 files changed
+151
-111
No files matched your search
@@ -36,7 +36,7 @@ let
|
||||
|
||||
# $1 asn.txt, $2 sni.txt, $3 AS-to-prefix map; prints a sing-box source rule-set
|
||||
# with the prefixes of every cut-off network that no whitelisted name fixes.
|
||||
proxyRules = pkgs.writeShellScript "proxy-suite-zapret2-cutoff-rules" ''
|
||||
proxyRules = pkgs.writeShellScript "proxy-suite-zapret2" ''
|
||||
set -euo pipefail
|
||||
${pkgs.gawk}/bin/awk -F'\t' '
|
||||
FILENAME == ARGV[1] { if ($1 ~ /^[0-9]+$/) cut[$1] = 1; next }
|
||||
@@ -48,7 +48,7 @@ let
|
||||
| {version: 1, rules: (if length > 0 then [{ip_cidr: .}] else [] end)}'
|
||||
'';
|
||||
|
||||
probe = pkgs.writeShellScript unit ''
|
||||
probe = pkgs.writeShellScript "proxy-suite-zapret2" ''
|
||||
set -euo pipefail
|
||||
export PATH=${
|
||||
lib.makeBinPath [
|
||||
@@ -130,7 +130,7 @@ let
|
||||
# The probe measures this line, so its traffic leaves directly: proxyMark keeps it
|
||||
# out of TUN/TProxy like the backend's own, and the conntrack bit keeps zapret2 from
|
||||
# touching or learning it.
|
||||
exempt = pkgs.writeShellScript "${unit}-exempt" ''
|
||||
exempt = pkgs.writeShellScript "proxy-suite-zapret2" ''
|
||||
set -euo pipefail
|
||||
${nft} delete table inet ${table} 2>/dev/null || true
|
||||
${nft} -f - <<EOF
|
||||
|
||||
@@ -83,7 +83,7 @@ let
|
||||
if zapret2Cfg.profiles == null && isZ2k then
|
||||
"${z2kGenerated}/profiles"
|
||||
else
|
||||
pkgs.writeText "proxy-suite-zapret2-profiles" (
|
||||
pkgs.writeText "proxy-suite-zapret2" (
|
||||
lib.concatStringsSep " --new " (map renderProfile (orSource zapret2Cfg.profiles source.profiles))
|
||||
);
|
||||
|
||||
@@ -91,7 +91,7 @@ let
|
||||
if isZ2k then
|
||||
"${z2kGenerated}/blobs"
|
||||
else
|
||||
pkgs.writeText "proxy-suite-zapret2-blobs" (lib.concatStringsSep " " source.blobArgs);
|
||||
pkgs.writeText "proxy-suite-zapret2" (lib.concatStringsSep " " source.blobArgs);
|
||||
|
||||
# The state layer wraps circular, so it loads after the source's Lua. z2k-tcp16
|
||||
# does nothing until the cutoff probe has written its maps.
|
||||
@@ -138,7 +138,7 @@ let
|
||||
modeFilter,
|
||||
}:
|
||||
let
|
||||
header = pkgs.writeText "proxy-suite-zapret2-config-header" (
|
||||
header = pkgs.writeText "proxy-suite-zapret2" (
|
||||
lib.concatStringsSep "\n" (
|
||||
[
|
||||
"# Generated by proxy-suite. Do not edit."
|
||||
@@ -175,7 +175,7 @@ let
|
||||
)
|
||||
);
|
||||
in
|
||||
pkgs.runCommand "proxy-suite-zapret2-config"
|
||||
pkgs.runCommand "proxy-suite-zapret2"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.gawk ];
|
||||
inherit circularFill optPrefix;
|
||||
@@ -259,7 +259,7 @@ let
|
||||
) exemptCidrs
|
||||
) chains;
|
||||
in
|
||||
pkgs.writeText "proxy-suite-zapret2-custom.sh" (
|
||||
pkgs.writeText "proxy-suite-zapret2" (
|
||||
lib.concatStringsSep "\n" (
|
||||
[ "zapret_custom_firewall_nft() {" ]
|
||||
++ rules
|
||||
|
||||
Reference in new issue
Block a user