Files
nix-config/modules/nixos/homeassistant/services/thread/default.nix
mjallen18 639ce36cb0 otbr
2026-01-12 15:13:02 -06:00

42 lines
1.2 KiB
Nix

{ inputs, config, namespace, lib, pkgs, ... }:
let
inherit (lib.${namespace}) mkModule mkOpt mkBoolOpt;
name = "otbr";
cfg = config.${namespace}.services.${name};
otbrPackage = pkgs.callPackage "${inputs.nixpkgs-otbr}/pkgs/by-name/op/openthread-border-router/package.nix" { };
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;
backboneInterface = "enp2s0";
package = otbrPackage;
rest = {
listenAddress = cfg.listenAddress;
listenPort = cfg.restPort;
};
web = {
listenAddress = cfg.listenAddress;
listenPort = cfg.port;
};
radio = {
device = "/dev/serial/by-idusb-dresden_elektronik_Thread_RCP__ConBee_II__DE2475318-if00";
baudRate = 460800;
flowControl = true;
};
};
};
};
in
{
imports = [
"${inputs.nixpkgs-otbr}/nixos/modules/services/home-automation/openthread-border-router.nix"
otbrConfig
];
}