refactor: update network interface types and configuration

This commit is contained in:
Giulio De Pasquale 2025-04-26 17:09:32 +01:00 committed by Giulio De Pasquale (aider)
parent 309872f4f2
commit 2d4bdd0cfd

View File

@ -15,8 +15,8 @@ in
};
type = mkOption {
type = types.enum [ "lan" "wan" "tailscale" ];
description = "The type of interface (lan, wan, or vpn/tailscale).";
type = types.enum [ "lan" "wan" "vpn" ];
description = "The type of interface (lan, wan, or vpn).";
};
net = mkOption {
@ -50,10 +50,10 @@ in
config = {
# 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;
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;
};
};
}