refactor: update network interface types and configuration
This commit is contained in:
parent
309872f4f2
commit
2d4bdd0cfd
@ -15,8 +15,8 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
type = types.enum [ "lan" "wan" "tailscale" ];
|
type = types.enum [ "lan" "wan" "vpn" ];
|
||||||
description = "The type of interface (lan, wan, or vpn/tailscale).";
|
description = "The type of interface (lan, wan, or vpn).";
|
||||||
};
|
};
|
||||||
|
|
||||||
net = mkOption {
|
net = mkOption {
|
||||||
@ -50,10 +50,10 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
# Create lists of interfaces by type for easy access elsewhere
|
# Create lists of interfaces by type for easy access elsewhere
|
||||||
pepe.core.network.interfacesByType = {
|
cfg.interfacesByType = {
|
||||||
lan = lib.filterAttrs (_: iface: iface.type == "lan") cfg.interfaces;
|
lan = lib.filterAttrs (_: iface: iface.type == "lan") cfg.interfaces;
|
||||||
wan = lib.filterAttrs (_: iface: iface.type == "wan") cfg.interfaces;
|
wan = lib.filterAttrs (_: iface: iface.type == "wan") cfg.interfaces;
|
||||||
vpn = lib.filterAttrs (_: iface: iface.type == "tailscale") cfg.interfaces;
|
vpn = lib.filterAttrs (_: iface: iface.type == "vpn") cfg.interfaces;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user