From 9f0a119c8ec7c27552e914be5cd896740560305d Mon Sep 17 00:00:00 2001 From: "Giulio De Pasquale (aider)" Date: Sat, 26 Apr 2025 17:05:48 +0100 Subject: [PATCH] refactor: remove interfaceTypes and simplify network interface type filtering --- modules/core/network.nix | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/modules/core/network.nix b/modules/core/network.nix index f44cfa7..28966e0 100644 --- a/modules/core/network.nix +++ b/modules/core/network.nix @@ -6,26 +6,6 @@ let in { options.pepe.core.network = { - interfaceTypes = { - lan = mkOption { - type = types.str; - default = "lan"; - description = "Key for LAN interface"; - }; - - wan = mkOption { - type = types.str; - default = "wan"; - description = "Key for WAN interface"; - }; - - vpn = mkOption { - type = types.str; - default = "tailscale"; - description = "Key for VPN interface"; - }; - }; - interfaces = mkOption { type = types.attrsOf (types.submodule { options = { @@ -71,9 +51,9 @@ in config = { # Create lists of interfaces by type for easy access elsewhere pepe.core.network.interfacesByType = { - lan = lib.filterAttrs (_: iface: iface.type == cfg.interfaceTypes.lan) cfg.interfaces; - wan = lib.filterAttrs (_: iface: iface.type == cfg.interfaceTypes.wan) cfg.interfaces; - vpn = lib.filterAttrs (_: iface: iface.type == cfg.interfaceTypes.vpn) cfg.interfaces; + 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; }; }; }