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 -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 ../.;