Compare commits

..

2 commits

Author SHA1 Message Date
b5cfb308a6
feat(home-assistant): set up Thread and Matter
Some checks failed
Test / tests (push) Failing after 32m1s
2026-01-03 22:14:46 +01:00
74f811a5e0
chore(flake): update inputs 2026-01-03 22:14:46 +01:00
4 changed files with 83 additions and 35 deletions

83
flake.lock generated
View file

@ -72,11 +72,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1762286984, "lastModified": 1766051518,
"narHash": "sha256-9I2H9x5We6Pl+DBYHjR1s3UT8wgwcpAH03kn9CqtdQc=", "narHash": "sha256-znKOwPXQnt3o7lDb3hdf19oDo0BLP4MfBOYiWkEHoik=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "9c870f63e28ec1e83305f7f6cb73c941e699f74f", "rev": "d5eff7f948535b9c723d60cd8239f8f11ddc90fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -129,11 +129,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1765253041, "lastModified": 1767413017,
"narHash": "sha256-D4/vwhvX26KW3gux9CCiJ87zc5UOiLTFlfG3+5h0VRI=", "narHash": "sha256-y36ZRvxafUhaJUZVMp4CWR5wuVNhHJDrr2SZRIy9zaY=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "687d6eb2a8503afdeaaf9e230fb72f880daa7252", "rev": "77a1aeceb7be71542dcef4ea6707f657cb0f9496",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -178,15 +178,15 @@
"flake-compat_3": { "flake-compat_3": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1761588595, "lastModified": 1767039857,
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=", "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra", "owner": "NixOS",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5", "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "edolstra", "owner": "NixOS",
"repo": "flake-compat", "repo": "flake-compat",
"type": "github" "type": "github"
} }
@ -198,11 +198,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763759067, "lastModified": 1765835352,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", "rev": "a34fae9c08a15ad73f295041fec82323541400a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -299,11 +299,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765170903, "lastModified": 1767280655,
"narHash": "sha256-O8VTGey1xxiRW+Fpb+Ps9zU7ShmxUA1a7cMTcENCVNg=", "narHash": "sha256-YmaYMduV5ko8zURUT1VLGDbVC1L/bxHS0NsiPoZ6bBM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "20561be440a11ec57a89715480717baf19fe6343", "rev": "d49d2543f02dbd789ed032188c84570d929223cb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -353,11 +353,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1764440730, "lastModified": 1767185284,
"narHash": "sha256-ZlJTNLUKQRANlLDomuRWLBCH5792x+6XUJ4YdFRjtO4=", "narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "9154f4569b6cdfd3c595851a6ba51bfaa472d9f3", "rev": "40b1a28dce561bea34858287fbb23052c3ee63fe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -368,11 +368,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1764983851, "lastModified": 1767325753,
"narHash": "sha256-y7RPKl/jJ/KAP/VKLMghMgXTlvNIJMHKskl8/Uuar7o=", "narHash": "sha256-yA/CuWyqm+AQo2ivGy6PlYrjZBQm7jfbe461+4HF2fo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d9bc5c7dceb30d8d6fafa10aeb6aa8a48c218454", "rev": "64049ca74d63e971b627b5f3178d95642e61cedd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -382,13 +382,29 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": { "nixpkgs-otbr": {
"locked": { "locked": {
"lastModified": 1765186076, "lastModified": 1766776257,
"narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", "narHash": "sha256-MG9DnzBn6TdAztaMPVhW9sjYj2bi9Jcux0F0fJ6LeO4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", "rev": "0c4c97066d555b7d27a0a56ee400130ec51f02ee",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "refs/pull/332296/head",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1767379071,
"narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fb7944c166a3b630f177938e478f0378e64ce108",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -423,11 +439,11 @@
"systems": "systems_3" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1765269853, "lastModified": 1767433926,
"narHash": "sha256-F/54YLlz7FEmE45lWXyhVXPaBRHy31ttuPhGCbXH+Os=", "narHash": "sha256-16+Qr/7DjMFLsKBJycJhOv3TZz59w9Tv5E24ZNLTmvk=",
"owner": "astro", "owner": "astro",
"repo": "nix-openwrt-imagebuilder", "repo": "nix-openwrt-imagebuilder",
"rev": "885f9ccc245b8a1d9a537bb28b3fbbd12a038165", "rev": "23f902fa4c3486dd4d1564c1da55a3f2eda77b79",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -445,11 +461,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1765016596, "lastModified": 1767281941,
"narHash": "sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ=", "narHash": "sha256-6MkqajPICgugsuZ92OMoQcgSHnD6sJHwk8AxvMcIgTE=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c", "rev": "f0927703b7b1c8d97511c4116eb9b4ec6645a0fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -471,6 +487,7 @@
"matrix-appservices": "matrix-appservices", "matrix-appservices": "matrix-appservices",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-otbr": "nixpkgs-otbr",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nvim-kitty-navigator": "nvim-kitty-navigator", "nvim-kitty-navigator": "nvim-kitty-navigator",
"openwrt-imagebuilder": "openwrt-imagebuilder", "openwrt-imagebuilder": "openwrt-imagebuilder",

View file

@ -17,6 +17,9 @@ rec {
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
# https://github.com/NixOS/nixpkgs/pull/332296
nixpkgs-otbr.url = "github:NixOS/nixpkgs/?ref=refs/pull/332296/head";
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
disko = { disko = {

View file

@ -1,5 +1,6 @@
{ {
config, config,
lib,
pkgs, pkgs,
inputs, inputs,
... ...
@ -7,12 +8,17 @@
let let
port = config.services.home-assistant.config.http.server_port; port = config.services.home-assistant.config.http.server_port;
devices = {
zigbee = "/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231009144806-if00";
thread = "/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231009150648-if00";
};
in in
{ {
disabledModules = [ "services/home-automation/home-assistant.nix" ]; disabledModules = [ "services/home-automation/home-assistant.nix" ];
imports = [ imports = [
"${inputs.nixpkgs-unstable}/nixos/modules/services/home-automation/home-assistant.nix" "${inputs.nixpkgs-unstable}/nixos/modules/services/home-automation/home-assistant.nix"
"${inputs.nixpkgs-otbr}/nixos/modules/services/home-automation/openthread-border-router.nix"
./wyoming.nix ./wyoming.nix
# ./esphome.nix # HINT currently unused # ./esphome.nix # HINT currently unused
]; ];
@ -45,7 +51,9 @@ in
"otp" "otp"
"upnp" "upnp"
"zha" "zha"
# "matter" # TODO uses insecure version of openssl "thread"
"otbr"
"matter"
# "esphome" # HINT currently unused # "esphome" # HINT currently unused
"homekit_controller" "homekit_controller"
"fritz" "fritz"
@ -114,6 +122,26 @@ in
# configWritable = true; # doesn't work atm # configWritable = true; # doesn't work atm
}; };
services.matter-server = {
enable = true;
};
services.openthread-border-router = {
enable = true;
package = inputs.nixpkgs-otbr.legacyPackages.${pkgs.system}.openthread-border-router;
radio = {
device = devices.thread;
baudRate = 460800;
extraDevices = [ "trel://enp2s0" ];
};
backboneInterface = "enp2s0";
rest.listenPort = 58081;
web.listenPort = 58082;
};
# systemd-resolved is already providing mDNS, but avahi seems to be required for otbr
services.avahi.enable = lib.mkOverride 40 true;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
1400 # Sonos discovery 1400 # Sonos discovery
]; ];

View file

@ -110,7 +110,7 @@ in
}; };
# mDNS already handled by systemd-resolved # mDNS already handled by systemd-resolved
services.avahi.enable = false; services.avahi.enable = lib.mkForce false;
programs.mtr.enable = true; programs.mtr.enable = true;
programs.mosh.enable = true; programs.mosh.enable = true;