openthread-border-router: add service on stinger #1140
No files matched your search
@@ -102,6 +102,7 @@
|
||||
];
|
||||
allowedUDPPorts = lib.mkForce [
|
||||
443 # HTTP 3
|
||||
5353 # mDNS (OTBR / Thread SRP)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -101,6 +101,7 @@ in
|
||||
};
|
||||
home = {
|
||||
iot = {
|
||||
slzb-06mu = "10.239.19.15";
|
||||
stinger = "10.239.19.8";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -58,6 +58,7 @@ in
|
||||
];
|
||||
ntfy = "boron.cx.${config.ogygia.domain}";
|
||||
offline-youtube = "phoenix.st.${config.ogygia.domain}";
|
||||
openthread-border-router = "stinger.pop.${config.ogygia.domain}";
|
||||
openwebui = "warlock.cx.${config.ogygia.domain}";
|
||||
personal_agent = "fanboy.cx.${config.ogygia.domain}";
|
||||
privatebin = "boron.cx.${config.ogygia.domain}";
|
||||
|
||||
@@ -427,6 +427,11 @@
|
||||
hwAddress = "3c:0f:02:c2:fd:90";
|
||||
dhcpReservation = true;
|
||||
};
|
||||
"15" = {
|
||||
hostname = "slzb-06mu";
|
||||
hwAddress = "52:78:7d:d7:1a:5c";
|
||||
dhcpReservation = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
./nix-remote-builder.nix
|
||||
./ntfy.nix
|
||||
./offline-youtube
|
||||
./openthread-border-router.nix
|
||||
./openwebui
|
||||
./personal-agent
|
||||
./privatebin.nix
|
||||
|
||||
@@ -144,10 +144,12 @@ in
|
||||
"met"
|
||||
"mobile_app"
|
||||
"mqtt"
|
||||
"otbr"
|
||||
"otp"
|
||||
"smartthings"
|
||||
"sonos"
|
||||
"sun"
|
||||
"thread"
|
||||
"unifi"
|
||||
"wake_on_lan"
|
||||
"waze_travel_time"
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
{ config, lib, pkgs, nixpkgs-unstable, ... }:
|
||||
|
||||
let
|
||||
cfg = config.custom.services.openthread-border-router;
|
||||
in
|
||||
{
|
||||
imports = [ "${nixpkgs-unstable}/nixos/modules/services/home-automation/openthread-border-router.nix" ];
|
||||
disabledModules = [ "services/home-automation/openthread-border-router.nix" ];
|
||||
|
||||
options.custom.services.openthread-border-router = {
|
||||
enable = lib.mkEnableOption "openthread-border-router";
|
||||
|
||||
radioHost = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "slzb-06mu.iot.home.jakehillion.me";
|
||||
description = "Host of the network-attached Thread RCP.";
|
||||
};
|
||||
|
||||
radioPort = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 6638;
|
||||
description = "TCP port of the network-attached Thread RCP.";
|
||||
};
|
||||
|
||||
backboneInterface = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "iot";
|
||||
description = "Backbone interface for Thread border routing (mDNS/SRP, TREL).";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
custom.impermanence.extraDirs = lib.mkIf config.custom.impermanence.enable [ "/var/lib/thread" ];
|
||||
|
||||
systemd.services.otbr-socat = {
|
||||
description = "socat TCP <-> pty bridge for OTBR Thread RCP";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.socat}/bin/socat -d pty,raw,echo=0,link=/run/otbr/ttyOTBR,ignoreeof tcp:${cfg.radioHost}:${toString cfg.radioPort}";
|
||||
RuntimeDirectory = "otbr";
|
||||
RuntimeDirectoryPreserve = "yes";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.otbr-agent = {
|
||||
requires = [ "otbr-socat.service" ];
|
||||
after = [ "otbr-socat.service" ];
|
||||
};
|
||||
|
||||
services.openthread-border-router = {
|
||||
enable = true;
|
||||
package = pkgs.unstable.openthread-border-router;
|
||||
backboneInterfaces = [ cfg.backboneInterface ];
|
||||
radio.url = "spinel+hdlc+uart:///run/otbr/ttyOTBR?uart-baudrate=460800&uart-init-deassert";
|
||||
radio.extraDevices = [ "trel://${cfg.backboneInterface}" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user