otbr
This commit is contained in:
17
flake.lock
generated
17
flake.lock
generated
@@ -1086,6 +1086,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-otbr": {
|
||||
"locked": {
|
||||
"lastModified": 1766776257,
|
||||
"narHash": "sha256-MG9DnzBn6TdAztaMPVhW9sjYj2bi9Jcux0F0fJ6LeO4=",
|
||||
"owner": "mrene",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0c4c97066d555b7d27a0a56ee400130ec51f02ee",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "mrene",
|
||||
"ref": "openthread-border-router",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1751048012,
|
||||
@@ -1472,6 +1488,7 @@
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixos-raspberrypi": "nixos-raspberrypi",
|
||||
"nixpkgs": "nixpkgs_12",
|
||||
"nixpkgs-otbr": "nixpkgs-otbr",
|
||||
"nixpkgs-stable": "nixpkgs-stable_2",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"pre-commit-hooks-nix": "pre-commit-hooks-nix",
|
||||
|
||||
@@ -1,19 +1,25 @@
|
||||
{ config, lib, ... }:
|
||||
{ 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 = { };
|
||||
options = {
|
||||
restPort = mkOpt lib.types.int 8081 "";
|
||||
};
|
||||
moduleConfig = {
|
||||
services.openthread-border-router = {
|
||||
enable = true;
|
||||
backboneInterface = "enp2s0";
|
||||
package = otbrPackage;
|
||||
rest = {
|
||||
listenAddress = cfg.listenAddress;
|
||||
listenPort = cfg.port;
|
||||
listenPort = cfg.restPort;
|
||||
};
|
||||
web = {
|
||||
listenAddress = cfg.listenAddress;
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowPing = true;
|
||||
allowedTCPPorts = [ 8192 ];
|
||||
allowedUDPPorts = [ 8192 ];
|
||||
allowedTCPPorts = [ 8192 8080 8081 ];
|
||||
allowedUDPPorts = [ 8192 8080 8081 ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -68,24 +68,31 @@
|
||||
# # Services # #
|
||||
# ###################################################
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
automation = {
|
||||
lightswitch = {
|
||||
living-room-lights = {
|
||||
id = 1741726347213;
|
||||
alias = "Living Room Light Switch";
|
||||
mqttDeviceId = "958ff6b3c9df0db21e418aaf6410b996";
|
||||
lightEntityId = "light.living_room_lights";
|
||||
};
|
||||
bedroom-lights = {
|
||||
id = 1741726231261;
|
||||
alias = "Bedroom Light Switch";
|
||||
mqttDeviceId = "de0f34498214842dcccaa6b08967d6b5";
|
||||
lightEntityId = "light.bedroom_lights";
|
||||
services = {
|
||||
home-assistant = {
|
||||
enable = true;
|
||||
automation = {
|
||||
lightswitch = {
|
||||
living-room-lights = {
|
||||
id = 1741726347213;
|
||||
alias = "Living Room Light Switch";
|
||||
mqttDeviceId = "958ff6b3c9df0db21e418aaf6410b996";
|
||||
lightEntityId = "light.living_room_lights";
|
||||
};
|
||||
bedroom-lights = {
|
||||
id = 1741726231261;
|
||||
alias = "Bedroom Light Switch";
|
||||
mqttDeviceId = "de0f34498214842dcccaa6b08967d6b5";
|
||||
lightEntityId = "light.bedroom_lights";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
otbr = {
|
||||
enable = true;
|
||||
restPort = 8081;
|
||||
port = 8080;
|
||||
};
|
||||
};
|
||||
|
||||
# ###################################################
|
||||
|
||||
Reference in New Issue
Block a user