fix: vless fixes

This commit is contained in:
FUFSoB committed 2026-06-06 13:47:59 +05:00
1 parent 334755fd0e
commit 32bf2266c0
7 files changed
+171 -13

No files matched your search

+18
View File
@@ -200,6 +200,19 @@ let
minimalProxyCtlWrapper = _minimalProxyCtl.wrapper;
minimalProxyCtlScript = _minimalProxyCtl.script;
minimalSocksService = minimal.config.systemd.services."proxy-suite-socks";
customSingBoxPackage = pkgs.writeShellScriptBin "sing-box" ''
exit 0
'';
customSingBoxPackageFixture = evalProxySuite [
baseModule
{
services.proxy-suite.singBox.package = customSingBoxPackage;
}
];
customSingBoxPackageBin = "${builtins.unsafeDiscardStringContext (toString customSingBoxPackage)}/bin/sing-box";
customSingBoxPackageStartScript = builtins.readFile (
customSingBoxPackageFixture.config.systemd.services."proxy-suite-socks".serviceConfig.ExecStart
);
routeModeFixture = evalProxySuite [
baseModule
@@ -1415,6 +1428,11 @@ let
assert builtins.elem "network-online.target" zapretSyncService.wants;
true
)
# -- sing-box package override propagates into generated service scripts --
(
assert pkgs.lib.hasInfix customSingBoxPackageBin customSingBoxPackageStartScript;
true
)
(
assert duplicateTags.success == false;
true
+18 -2
View File
@@ -19,6 +19,22 @@ let
];
};
filterGeneratedOptions = lib.filterAttrs (name: _: name != "_module");
docPackagePlaceholder = "__proxy_suite_doc_pkg_sing_box__";
sanitizeConfigForDocs =
config:
config
// {
singBox =
(config.singBox or { })
// lib.optionalAttrs ((config.singBox or { }) ? package) {
package = docPackagePlaceholder;
};
};
renderConfigText =
config:
lib.replaceStrings [ "\"${docPackagePlaceholder}\"" ] [ "pkgs.sing-box" ] (
lib.generators.toPretty { } (sanitizeConfigForDocs config)
);
mkGeneratedExampleValue =
option:
if (option ? _type) && option._type == "option" then
@@ -32,8 +48,8 @@ let
throw "Cannot generate example value for option ${lib.showOption option.loc}"
else
lib.mapAttrs (_: mkGeneratedExampleValue) (filterGeneratedOptions option);
defaultConfigText = lib.generators.toPretty { } eval.config.services.proxy-suite;
exampleConfigText = lib.generators.toPretty { } (
defaultConfigText = renderConfigText eval.config.services.proxy-suite;
exampleConfigText = renderConfigText (
lib.mapAttrs (_: mkGeneratedExampleValue) (filterGeneratedOptions eval.options.services.proxy-suite)
);
repoRoot = toString ../.;