refactor: remove duplication

This commit is contained in:
FUFSoB committed 2026-09-18 21:39:18 +05:00
1 parent f7036f6075
commit 8a4ba2db6a
109 files changed
+2206 -3078

No files matched your search

@@ -1,16 +1,18 @@
# Per-app routing profile expansion and proxychains config.
{
lib,
pkgs,
proxyCfg,
perAppRoutingCfg,
perAppRoutingTun,
perAppRoutingTproxy,
perAppZapretCfg,
runtimeDir,
}:
{ ctx }:
let
inherit (ctx)
lib
pkgs
proxyCfg
perAppRoutingCfg
perAppRoutingTun
perAppRoutingTproxy
perAppZapretCfg
constants
;
inherit (constants) runtimeDir;
perAppRoutingProfileNames = map (profile: profile.name) perAppRoutingCfg.profiles;
defaultPerAppRoutingProfiles = lib.optionals perAppRoutingCfg.createDefaultProfiles (
[
@@ -46,9 +48,7 @@ let
effectivePerAppRoutingProfileNames = map (profile: profile.name) effectivePerAppRoutingProfiles;
localProxyAuth = proxyCfg.listener.auth;
localProxyAuthEnabled =
localProxyAuth.username != null
&& (localProxyAuth.password != null || localProxyAuth.passwordFile != null);
localProxyAuthEnabled = ctx.localProxy.authEnabled;
perAppRoutingProfilesFile = pkgs.writeText "proxy-suite-per-app" (
builtins.toJSON effectivePerAppRoutingProfiles