feat: awg runtime add

This commit is contained in:
fufsob committed 2026-09-28 18:51:47 +00:00
1 parent cd3aa5a53f
commit 364bed8d51
39 files changed
+1581 -190

No files matched your search

+30
View File
@@ -165,6 +165,18 @@ let
];
smCfg = systemManager.config;
# AmneziaWG with nothing declared: outbounds added with proxy-ctl run as user units.
hmRuntimeAwg = evalHost "homeManager" [
rootlessSettings
{
services.proxy-suite.amneziaWg = {
enable = true;
kernelModulePackage = null;
};
}
];
hmRuntimeAwgUnits = hmRuntimeAwg.config.systemd.user.services;
nixOnDroid = evalHost "nixOnDroid" [ rootlessSettings ];
nodCfg = nixOnDroid.config;
@@ -200,6 +212,17 @@ in
));
true
)
(
# Rootless: AmneziaWG outbounds added at runtime, never a global profile.
assert failedAssertions hmRuntimeAwg == [ ];
assert hmRuntimeAwgUnits ? "proxy-suite-awg-tunnel@";
assert hmRuntimeAwgUnits ? proxy-suite-awg-runtime-sync;
assert !(hmRuntimeAwgUnits ? "proxy-suite-awg@");
assert
!(lib.hasInfix "setpriv" (toString hmRuntimeAwgUnits."proxy-suite-awg-tunnel@".Service.ExecStart));
assert forced hmRuntimeAwgUnits;
true
)
(
# Rootless, the socks unit only listens: no TProxy inbound, no SO_MARK.
assert lib.any (inbound: inbound.type == "mixed") hmSocksConfig.inbounds;
@@ -244,6 +267,13 @@ in
perAppRouting.zapret.enable = true;
} "perAppRouting.zapret needs root";
assert rejects "nixOnDroid" { gui.enable = true; } "the GUI needs a desktop session";
# No templates in proxy-suitectl, and no root for a global profile: nothing to add to.
assert rejects "nixOnDroid" {
amneziaWg = {
enable = true;
kernelModulePackage = null;
};
} "amneziaWg.enable needs a profile";
assert rejects "nixOnDroid" {
inbounds.listeners.vless.port = lib.mkForce 443;
} "inbounds.listeners.vless.port = 443 is a privileged port";