fix: modify network interface type handling to resolve Nix type error
This commit is contained in:
parent
a5232f522b
commit
738b0e9577
@ -48,7 +48,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
interfacesByType = mkOption {
|
interfacesByType = mkOption {
|
||||||
type = types.attrsOf (types.attrsOf types.anything);
|
type = types.attrsOf (types.listOf types.str);
|
||||||
default = {};
|
default = {};
|
||||||
description = "Interfaces grouped by type (lan, wan, vpn) for easy access.";
|
description = "Interfaces grouped by type (lan, wan, vpn) for easy access.";
|
||||||
internal = true;
|
internal = true;
|
||||||
@ -69,9 +69,9 @@ 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 = {
|
pepe.core.network.interfacesByType = {
|
||||||
lan = lib.filterAttrs (_: iface: iface.type == "lan") cfg.interfaces;
|
lan = lib.attrNames (lib.filterAttrs (_: iface: iface.type == "lan") cfg.interfaces);
|
||||||
wan = lib.filterAttrs (_: iface: iface.type == "wan") cfg.interfaces;
|
wan = lib.attrNames (lib.filterAttrs (_: iface: iface.type == "wan") cfg.interfaces);
|
||||||
vpn = lib.filterAttrs (_: iface: iface.type == "vpn") cfg.interfaces;
|
vpn = lib.attrNames (lib.filterAttrs (_: iface: iface.type == "vpn") cfg.interfaces);
|
||||||
};
|
};
|
||||||
|
|
||||||
# We don't need the groups anymore as we're using interfacesByType directly
|
# We don't need the groups anymore as we're using interfacesByType directly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user