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

lastFile:clan.nix
This commit is contained in:
2026-08-07 14:50:25 +07:00
parent 73a2f737c3
commit b10343c194
2 changed files with 24 additions and 3 deletions
+21 -3
View File
@@ -77,7 +77,7 @@
description = "Static DHCP leases; the attribute name becomes the client's hostname.";
};
};
allowWAN = lib.mkOption {
allowedWAN = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether clients on this VLAN may reach the internet.";
@@ -142,7 +142,10 @@
'';
};
secondaryUpLink = lib.mkOption { };
upLinkPorts = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "DHCP-client uplink into the existing router LAN so this machine has internet";
};
};
};
@@ -212,6 +215,7 @@
};
};
}
// lib.optionalAttrs (settings.wan.vlanId != null) {
"15-wan-lan" = {
matchConfig.Name = "wan-vlan";
@@ -219,6 +223,7 @@
linkConfig.RequiredForOnline = "no";
};
}
// {
"20-br0" = {
matchConfig.Name = "br0";
@@ -228,6 +233,7 @@
linkConfig.RequiredForOnline = "no";
};
}
// lib.listToAttrs (
map (port: {
name = "25-trunk-${port}";
@@ -239,6 +245,7 @@
};
}) settings.trunkPorts
)
// lib.mapAttrs' (
iface: port:
lib.nameValuePair "25-access-${iface}" {
@@ -254,6 +261,7 @@
linkConfig.RequiredForOnline = "no";
}
) settings.accessPorts
// lib.mapAttrs' (
name: vlan:
lib.nameValuePair "40-${vlanIf name}" {
@@ -267,7 +275,17 @@
dhcpPrefixDelegationConfig.SubnetId = "auto";
linkConfig.RequiredForOnline = "no";
}
) settings.vlans;
) settings.vlans
// lib.listToAttrs (
map (port: {
name = "5-uplink-${port}";
value = {
matchConfig.Name = "${port}";
networkConfig.DHCP = "ipv4";
};
}) settings.upLinkPorts
);
environment.systemPackages = with pkgs; [
tcpdump