{ config, lib, pkgs, namespace, ... }: let inherit (lib) mkIf mkForce; inherit (lib.${namespace}) mkBoolOpt; cfg = config.${namespace}.system.networking; in { options.${namespace}.system.networking = { enable = lib.mkEnableOption "networking support"; enableIWD = mkBoolOpt false "enable iwd"; }; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ mtr tcpdump traceroute ]; reichard.user.extraGroups = [ "network" ]; networking = { firewall.enable = true; usePredictableInterfaceNames = mkForce true; } // (lib.optionalAttrs cfg.enableIWD) { wireless.iwd = { enable = true; settings.General.EnableNetworkConfiguration = true; }; }; # TODO - Network Configuration # (lib.mkIf (config.network != null) { # networking = { # inherit (config.network) defaultGateway nameservers; # interfaces.${config.network.interface}.ipv4.addresses = [{ # inherit (config.network) address; # prefixLength = 24; # }]; # }; # }) }; }