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

@@ -3,23 +3,24 @@
# Everything is emitted as shell functions taking a tag and a file holding the
# subscription URL, so a subscription declared in Nix and one added at runtime
# under `subscriptions.d/` go through exactly the same code.
{
lib,
pkgs,
proxyCfg,
hybridEnabled,
mainBackend,
backend,
stateDir,
runtimeSubscriptionsDir,
jq,
python3,
parserScriptsPythonPath,
fetchSubscriptionPy,
routingMarkJq,
}:
{ ctx }:
let
inherit (ctx)
lib
pkgs
proxyCfg
hybridEnabled
mainBackend
backend
constants
jq
python3
parserScriptsPythonPath
fetchSubscriptionPy
routingMarkJq
;
inherit (constants) stateDir runtimeSubscriptionsDir;
subscriptionBackend = if hybridEnabled then "hybrid" else mainBackend;
subscriptionBackendArg = "--backend ${subscriptionBackend}";
subscriptionCacheDir = "${stateDir}/subscriptions/${backend}";