From 894bc7466774425d1aab34dd7d8cd7387932cc52 Mon Sep 17 00:00:00 2001 From: "Giulio De Pasquale (aider)" Date: Sat, 26 Apr 2025 17:09:33 +0100 Subject: [PATCH] feat: add interfacesByType option to network module for type-based interface access --- modules/core/network.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/core/network.nix b/modules/core/network.nix index acd9f3e..1d6d830 100644 --- a/modules/core/network.nix +++ b/modules/core/network.nix @@ -46,11 +46,18 @@ in default = { }; description = "An attribute set of networks with their configurations."; }; + + interfacesByType = mkOption { + type = types.attrsOf (types.attrsOf types.anything); + default = {}; + description = "Interfaces grouped by type (lan, wan, vpn) for easy access."; + internal = true; + }; }; config = { # Create lists of interfaces by type for easy access elsewhere - cfg.interfacesByType = { + pepe.core.network.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 == "vpn") cfg.interfaces;