feat: proxy-gui

This commit is contained in:
FUFSoB committed 2026-09-15 00:15:53 +05:00
1 parent 8ed4ab9a8d
commit 7de094078c
44 files changed
+2994 -2016

No files matched your search

+1
View File
@@ -182,6 +182,7 @@ let
inherit (scripts) proxyInboundsLinksFile proxyInboundsSubscriptionsFile;
proxyInboundsSubscriptionsBaseUrl = proxyInboundsCfg.subscriptions.baseUrl;
inherit amneziaWgProfileNamesFile;
guiRefreshInterval = cfg.gui.refreshInterval;
inherit (perAppRouting)
perAppRoutingProfilesFile
proxychainsConfigFile
+2
View File
@@ -23,6 +23,7 @@
proxyInboundsLinksFile,
proxyInboundsSubscriptionsFile,
proxyInboundsSubscriptionsBaseUrl,
guiRefreshInterval,
}:
{
proxyCtl = packages.mkProxyCtl {
@@ -36,6 +37,7 @@
proxychainsQuietArg
routeModeStateFile
amneziaWgProfileNamesFile
guiRefreshInterval
;
defaultRouteMode = if (proxyCfg.routing.default == "proxy") then "blacklist" else "whitelist";
perAppRoutingEnabled = if perAppRoutingCfg.enable then "1" else "0";
+26 -2
View File
@@ -135,7 +135,11 @@ in
lib.mkMerge [
autoProxyUnits
{
environment.systemPackages = [ control.proxyCtl ] ++ lib.optional cfg.tui.enable control.proxyCtl.tui;
environment.systemPackages = [
control.proxyCtl
]
++ lib.optional cfg.tui.enable control.proxyCtl.tui
++ lib.optional cfg.gui.enable control.proxyCtl.gui;
# nftables must be on for transparent routing backends. Global TUN uses
# SingBox auto_redirect programs an `inet sing-box` nftables table.
@@ -195,7 +199,27 @@ lib.mkMerge [
]
);
systemd.user.services = mkNamedUnits userServiceEntries;
systemd.user.services = lib.mkMerge [
(mkNamedUnits userServiceEntries)
(lib.mkIf (cfg.gui.enable && cfg.gui.autostart) {
# Starts hidden in the tray with every graphical session.
proxy-suite-gui = {
description = "Proxy Suite GUI (tray icon)";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
unitConfig.ConditionEnvironment = [
"|WAYLAND_DISPLAY"
"|DISPLAY"
];
serviceConfig = {
ExecStart = "${control.proxyCtl.gui}/bin/proxy-suite-gui --hidden";
Restart = "on-failure";
RestartSec = 3;
};
};
})
];
assertions = import ../service-assertions.nix {
inherit lib cfg derived;