Includes, but not limited to: - zapret2 support - declarative inbounds - proxy-ctl revamp - automatic proxy learning
50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
{
|
|
nixpkgs,
|
|
pkgsFor,
|
|
proxySuiteModule,
|
|
}:
|
|
|
|
system:
|
|
|
|
let
|
|
pkgs = pkgsFor system;
|
|
lib = pkgs.lib;
|
|
eval = import "${nixpkgs}/nixos/lib/eval-config.nix" {
|
|
inherit system;
|
|
modules = [
|
|
proxySuiteModule
|
|
{ system.stateVersion = lib.trivial.release; }
|
|
];
|
|
};
|
|
|
|
# Visible options only (renamed aliases are hidden), packages shown by name.
|
|
visibleConfig =
|
|
opts: cfg:
|
|
lib.mapAttrs (
|
|
name: opt:
|
|
if !lib.isOption opt then
|
|
visibleConfig opt cfg.${name}
|
|
else if lib.isDerivation cfg.${name} then
|
|
{
|
|
__pretty = _: "pkgs.${lib.getName cfg.${name}}";
|
|
val = null;
|
|
}
|
|
else
|
|
cfg.${name}
|
|
) (lib.filterAttrs (name: opt: name != "_module" && (opt.visible or true) != false) opts);
|
|
|
|
optionDocs = pkgs.nixosOptionsDoc {
|
|
options.services.proxy-suite = eval.options.services.proxy-suite;
|
|
documentType = "none";
|
|
variablelistId = "proxy-suite-options";
|
|
optionIdPrefix = "proxy-suite-opt-";
|
|
transformOptions = opt: opt // { declarations = [ ]; };
|
|
};
|
|
in
|
|
import ./options-doc/render-options-markdown.nix {
|
|
inherit pkgs optionDocs;
|
|
defaultConfigText = lib.generators.toPretty { allowPrettyValues = true; } (
|
|
visibleConfig eval.options.services.proxy-suite eval.config.services.proxy-suite
|
|
);
|
|
}
|