Includes, but not limited to: - zapret2 support - declarative inbounds - proxy-ctl revamp - automatic proxy learning
122 lines
3.4 KiB
Nix
122 lines
3.4 KiB
Nix
{
|
|
pkgs,
|
|
evalProxySuite,
|
|
mkTProxyConfig,
|
|
mkTunConfig,
|
|
shellValueByPrefix,
|
|
}:
|
|
|
|
let
|
|
generated = import ../read-generated.nix;
|
|
|
|
hybridModule = {
|
|
system.stateVersion = "26.05";
|
|
services.proxy-suite = {
|
|
enable = true;
|
|
proxy = {
|
|
enable = true;
|
|
backend = "hybrid";
|
|
selection = "selector";
|
|
outbounds = [
|
|
{
|
|
tag = "primary";
|
|
url = "vless://uuid@example.com:443?type=tcp&security=reality&pbk=pubkey&fp=qq&sni=last.fm&sid=8a54&spx=%2F-%2Fen%2Fgp%2Fbestsellers&flow=xtls-rprx-vision&encryption=none";
|
|
}
|
|
{
|
|
tag = "xray-only";
|
|
url = "vless://uuid@example.com:443?type=xhttp&security=tls&sni=cdn.example.com&host=cdn.example.com&path=%2Fx";
|
|
}
|
|
];
|
|
tproxy.enable = true;
|
|
tun.enable = true;
|
|
};
|
|
perAppRouting.tun.enable = true;
|
|
};
|
|
};
|
|
hybridFixture = evalProxySuite [ hybridModule ];
|
|
hybridTproxyConfig = mkTProxyConfig hybridFixture;
|
|
hybridTunConfig = mkTunConfig hybridFixture;
|
|
hybridStartScript = generated.readDerivation (
|
|
hybridFixture.config.systemd.services."proxy-suite-socks".serviceConfig.ExecStart
|
|
);
|
|
hybridTunStartScript = generated.readDerivation (
|
|
hybridFixture.config.systemd.services."proxy-suite-tun".serviceConfig.ExecStart
|
|
);
|
|
hybridPerAppTunStartScript = generated.readDerivation (
|
|
hybridFixture.config.systemd.services."proxy-suite-per-app-tun".serviceConfig.ExecStart
|
|
);
|
|
hybridBackendJqFilter =
|
|
import ../../../modules/proxy-suite/service/script-blocks/backend-jq-filter.nix
|
|
{
|
|
lib = pkgs.lib;
|
|
proxyInboundsGuardPrivate = false;
|
|
pureXrayEnabled = false;
|
|
selectionMode = hybridFixture.config.services.proxy-suite.proxy.selection;
|
|
};
|
|
|
|
hybridXrayRawFixture = evalProxySuite [
|
|
{
|
|
system.stateVersion = "26.05";
|
|
services.proxy-suite = {
|
|
enable = true;
|
|
proxy = {
|
|
enable = true;
|
|
backend = "hybrid";
|
|
outbounds = [
|
|
{
|
|
tag = "raw-xray";
|
|
xrayJson = {
|
|
protocol = "freedom";
|
|
settings = { };
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|
|
];
|
|
hybridXrayRawStartScript = generated.readDerivation (
|
|
hybridXrayRawFixture.config.systemd.services."proxy-suite-socks".serviceConfig.ExecStart
|
|
);
|
|
|
|
hybridSubscriptionFixture = evalProxySuite [
|
|
{
|
|
system.stateVersion = "26.05";
|
|
services.proxy-suite = {
|
|
enable = true;
|
|
proxy = {
|
|
enable = true;
|
|
backend = "hybrid";
|
|
subscriptions = [
|
|
{
|
|
tag = "community";
|
|
url = "https://example.com/hybrid-sub";
|
|
}
|
|
];
|
|
selection = "selector";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
hybridSubscriptionStartScript = generated.readDerivation (
|
|
hybridSubscriptionFixture.config.systemd.services."proxy-suite-socks".serviceConfig.ExecStart
|
|
);
|
|
hybridSubscriptionUpdateScript = generated.readDerivation (
|
|
hybridSubscriptionFixture.config.systemd.services."proxy-suite-subscription-update".serviceConfig.ExecStart
|
|
);
|
|
in
|
|
{
|
|
inherit
|
|
hybridBackendJqFilter
|
|
hybridFixture
|
|
hybridPerAppTunStartScript
|
|
hybridStartScript
|
|
hybridSubscriptionStartScript
|
|
hybridSubscriptionUpdateScript
|
|
hybridTproxyConfig
|
|
hybridTunConfig
|
|
hybridTunStartScript
|
|
hybridXrayRawStartScript
|
|
;
|
|
}
|