# proxy-suite (github:FUFSoB/proxy-suite-flake): zapret DPI bypass, the # Telegram WebSocket proxy and the GUI. The MTProto secret is an agenix secret: # secrets/tg-ws-proxy-secret.age the secret (32 hex digits) # (nix run .#secret-from-file -- tg-ws-proxy-secret.age ) # proxy-suite reads it through systemd LoadCredential, so root ownership is # enough. Without the file the Telegram proxy stays off and a warning says so. { config, inputs, lib, ... }: let tgSecret = config.meta.secretsDir + "/tg-ws-proxy-secret.age"; hasTgSecret = builtins.pathExists tgSecret; in { flake.modules.nixos.proxy-suite = { config, ... }: { imports = [ inputs.proxy-suite.nixosModules.default ]; age.secrets = lib.optionalAttrs hasTgSecret { tg-ws-proxy-secret = { file = tgSecret; mode = "0400"; }; }; services.proxy-suite = { enable = true; proxy = { enable = false; }; # perAppRouting = { # enable = true; # createDefaultProfiles = true; # proxychains.enable = true; # tun.enable = true; # tproxy.enable = true; # zapret.enable = true; # }; zapret = { enable = true; zapret-discord-youtube.configName = "general(ALT)"; }; tgWsProxy = { enable = hasTgSecret; secretFile = if hasTgSecret then config.age.secrets.tg-ws-proxy-secret.path else null; bypassTransparentProxy = true; }; gui.enable = true; }; warnings = lib.optional (!hasTgSecret) '' The Telegram WebSocket proxy (services.proxy-suite.tgWsProxy) is off: secrets/tg-ws-proxy-secret.age is missing. Create it with the command in secrets/README.md (32 random hex digits) and `git add` it. ''; }; }