puyak: manage zigbee via home-assistant

This commit is contained in:
makefu 2024-04-24 23:46:57 +02:00
parent c5a11854c5
commit 658f5c74a3
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
6 changed files with 16 additions and 10 deletions

6
flake.lock generated
View File

@ -18,11 +18,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1707956935, "lastModified": 1710272261,
"narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=", "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c", "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
imports = [ imports = [
./net.nix ./net.nix
@ -170,4 +170,5 @@
isNormalUser = true; isNormalUser = true;
shell = "/run/current-system/sw/bin/zsh"; shell = "/run/current-system/sw/bin/zsh";
}; };
system.stateVersion = lib.mkForce "24.05";
} }

View File

@ -14,7 +14,7 @@ in {
interfaces."${ext-if}".ipv4.addresses = [ interfaces."${ext-if}".ipv4.addresses = [
{ {
address = shack-ip; address = shack-ip;
prefixLength = 22; prefixLength = 20;
} }
]; ];

View File

@ -1,5 +1,6 @@
{ config, ... }: { config,lib, ... }:
{ {
nixpkgs.config.allowUnfree = true; # "consul-1.18.0"
krebs.sync-containers3.containers.news = { krebs.sync-containers3.containers.news = {
sshKey = "${config.krebs.secret.directory}/news.sync.key"; sshKey = "${config.krebs.secret.directory}/news.sync.key";
}; };

View File

@ -3,10 +3,9 @@ let
kodi-host = "192.168.8.11"; kodi-host = "192.168.8.11";
confdir = "/var/lib/homeassistant-docker"; confdir = "/var/lib/homeassistant-docker";
in { in {
imports = [ imports = [ ./zigbee.nix ];
];
# networking.firewall.allowedTCPPorts = [ 8123 ]; networking.firewall.allowedTCPPorts = [ 8123 ];
virtualisation.oci-containers.containers.hass = { virtualisation.oci-containers.containers.hass = {
image = "homeassistant/home-assistant:latest"; image = "homeassistant/home-assistant:latest";
environment = { environment = {
@ -16,7 +15,7 @@ in {
PGID = toString config.users.groups.news_container.gid; PGID = toString config.users.groups.news_container.gid;
UMASK = "007"; UMASK = "007";
}; };
extraOptions = ["--net=host" ]; extraOptions = ["--net=host" "--device=/dev/zigbee" ];
volumes = [ volumes = [
"${confdir}:/config" "${confdir}:/config"
#"${confdir}/docker-run:/etc/services.d/home-assistant/run:" #"${confdir}/docker-run:/etc/services.d/home-assistant/run:"

View File

@ -0,0 +1,5 @@
{
services.udev.extraRules = ''
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="zigbee", MODE="0666"
'';
}