{ inputs, config, namespace, lib, pkgs, ... }: let inherit (lib.${namespace}) mkOpt; name = "otbr"; cfg = config.${namespace}.services.${name}; otbrConfig = lib.${namespace}.mkModule { inherit config name; description = "Openthread border router"; options = { restPort = mkOpt lib.types.int 8081 ""; }; moduleConfig = { services.openthread-border-router = { enable = true; backboneInterfaces = [ "enp2s0" ]; rest = { inherit (cfg) listenAddress; listenPort = cfg.restPort; }; web = { inherit (cfg) listenAddress; listenPort = cfg.port; }; radio = { device = "/dev/serial/by-id/usb-dresden_elektronik_Thread_RCP__ConBee_II__DE2475318-if00"; baudRate = 460800; flowControl = true; }; }; }; }; in { imports = [ otbrConfig ]; }