63 lines
1.8 KiB
Nix
63 lines
1.8 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
proxySuiteUpstream,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (lib)
|
|
mkEnableOption
|
|
mkOption
|
|
types
|
|
;
|
|
t = import ./types.nix { inherit lib; };
|
|
awgPackages = proxySuiteUpstream.amneziaWg;
|
|
in
|
|
{
|
|
options.services.proxy-suite.amneziaWg = {
|
|
enable = mkEnableOption "native AmneziaWG client profiles";
|
|
|
|
toolsPackage = mkOption {
|
|
type = types.package;
|
|
default = awgPackages.tools;
|
|
description = "AWG 3.1 package providing awg and awg-quick.";
|
|
};
|
|
|
|
userspacePackage = mkOption {
|
|
type = types.package;
|
|
default = awgPackages.userspace;
|
|
description = "AWG 3.1 userspace implementation used when the kernel interface is unavailable.";
|
|
};
|
|
|
|
wireproxyPackage = mkOption {
|
|
type = types.package;
|
|
default = awgPackages.wireproxy;
|
|
description = "wireproxy build with AWG 3.1 and FwMark, which runs profiles with asOutbound = \"userspace\".";
|
|
};
|
|
|
|
kernelModulePackage = mkOption {
|
|
type = types.nullOr types.package;
|
|
default =
|
|
let
|
|
kernelPackages = config.services.proxy-suite.host.kernelPackages;
|
|
in
|
|
if kernelPackages == null then null else awgPackages.kernelModule kernelPackages;
|
|
description = "AWG 3.1 kernel module package. Set null to use userspace-only fallback.";
|
|
};
|
|
|
|
profiles = mkOption {
|
|
type = types.attrsOf t.profileType;
|
|
default = { };
|
|
description = ''
|
|
Named AmneziaWG client profiles. Only one global profile can be active.
|
|
|
|
A profile moves to a new source port, keeping its routes, when a handshake goes
|
|
unanswered: every 5 seconds while it starts (it gives up after 20), and when
|
|
proxy-suite-awg-NAME-watchdog sees a rekey not getting through. settings.listenPort
|
|
pins the port and turns that off.
|
|
'';
|
|
};
|
|
};
|
|
}
|