mob next [ci-skip] [ci skip] [skip ci]

lastFile:modules/clan/gw-router/default.nix
This commit is contained in:
2026-08-11 16:17:44 +07:00
parent 1f45fff740
commit 28e3c3cb95
3 changed files with 65 additions and 0 deletions
+39
View File
@@ -120,6 +120,43 @@
description = "TP-Link Omada SDN controller (podman container)";
};
proxy = {
enable = lib.mkEnableOption "internal reverse proxy (Caddy, wildcard cert via DNS-01)";
services = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule {
options = {
backend = lib.mkOption {
type = lib.types.str;
example = "https://127.0.0.1:8043";
description = "URL Caddy forwards to (internal/mesh address).";
};
insecureSkipVerify = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Skip TLS verification towards the backend.";
};
};
}
);
default = { };
description = "Proxied services";
};
allowVlans = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [
"mgmt"
"lan"
];
description = "VLANs whose clients may reach the proxy (443, plus 80 for the redirect).";
};
};
vlans = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule vlanModule);
description = "VLANs setup for this router";
@@ -314,5 +351,7 @@
./iperf.nix
./ipv6.nix
./pppoe.nix
./omada.nix
./proxy.nix
];
}
+25
View File
@@ -0,0 +1,25 @@
{
roles.default.perInstance = { settings, ... }: {
nixosModule =
{
config,
lib,
...
}:
let
in
{
config = lib.mkIf (settings.proxy.enable) {
assertions = [
{
assertion = lib.all (v: settings.vlans ? ${v}) settings.proxy.allowVlans;
message = "cnx.router.proxy.allowVlans must name VLANs defined in cnx.router.vlans.";
}
];
};
};
};
}