[NixOS] Configure otbr matter server and more for Home Assistant

This commit is contained in:
2025-01-29 00:51:36 -07:00
parent 9d8777e85c
commit accb330589
2 changed files with 46 additions and 1 deletions

View File

@@ -10,8 +10,47 @@
myModules.desktop.enable = true; myModules.desktop.enable = true;
myModules.xmonad.enable = true; myModules.xmonad.enable = true;
networking.enableIPv6 = true;
boot.kernel.sysctl = {
# For all interfaces (e.g. if you want to accept RA on all):
"net.ipv6.conf.all.accept_ra" = lib.mkForce "1";
"net.ipv6.conf.all.accept_ra_rt_info_max_plen" = lib.mkForce "64";
"net.ipv6.conf.default.accept_ra" = lib.mkForce "1";
"net.ipv6.conf.default.accept_ra_rt_info_max_plen" = lib.mkForce "64";
"net.ipv6.conf.wlo1.accept_ra" = lib.mkForce "1";
"net.ipv6.conf.wlo1.accept_ra_rt_info_max_plen" = lib.mkForce "64";
# Ensure forwarding is off on all interfaces unless needed
"net.ipv6.conf.all.forwarding" = lib.mkForce "0";
};
systemd.services.otbr-agent = {
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
};
services.openthread-border-router = {
enable = true;
backboneInterface = "wpan0";
logLevel = "debug";
radio = {
device = "/dev/serial/by-id/usb-Nabu_Casa_Home_Assistant_Connect_ZBT-1_0cd053abfa38ef119c66e1d154516304-if00-port0";
baudRate = 460800;
flowControl = true;
};
web = {
listenPort = 8087;
};
rest = {
listenPort = 8089;
};
};
services.matter-server = { services.matter-server = {
enable = true; enable = true;
logLevel = "debug";
extraArgs = ["--bluetooth-adapter=0"];
}; };
services.home-assistant = { services.home-assistant = {
@@ -24,8 +63,11 @@
"google_assistant" "google_assistant"
"homeassistant_hardware" "homeassistant_hardware"
"homeassistant_sky_connect" "homeassistant_sky_connect"
"homekit_controller"
"ibeacon"
"isal" "isal"
"kef" "kef"
"kegtron"
"matter" "matter"
"met" "met"
"opensky" "opensky"
@@ -49,6 +91,8 @@
boot.loader.systemd-boot.configurationLimit = 3; boot.loader.systemd-boot.configurationLimit = 3;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
@@ -73,7 +117,7 @@
networking.hostName = "justin-bieber-creek"; networking.hostName = "justin-bieber-creek";
networking.useDHCP = lib.mkDefault true; networking.useDHCP = false;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View File

@@ -120,6 +120,7 @@ final: prev:
python-with-my-packages = let python-with-my-packages = let
my-python-packages = python-packages: my-python-packages = python-packages:
with python-packages; [ with python-packages; [
universal-silabs-flasher
argcomplete argcomplete
appdirs appdirs
ipdb ipdb