Files
nix-config/modules/nixos/homeassistant/services/thread/default.nix
mjallen18 1767debfd8 upd
2026-04-16 12:38:07 -05:00

48 lines
949 B
Nix
Executable File

{
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
];
}