This repository has no description
1.3 kB
39 lines
1{ pkgs, ... }:
2{
3 imports = [
4 ./zigbee.nix
5 ];
6
7 krebs.iptables.tables.filter.INPUT.rules = [
8 { predicate = "-i int0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto
9 { predicate = "-i docker0 -p tcp --dport 1883"; target = "ACCEPT"; } # mosquitto
10 { predicate = "-i int0 -p tcp --dport 8123"; target = "ACCEPT"; } # hass
11 { predicate = "-i int0 -p tcp --dport 1337"; target = "ACCEPT"; } # zigbee2mqtt frontend
12 { predicate = "-i retiolum -p tcp --dport 8123"; target = "ACCEPT"; } # hass
13 { predicate = "-i retiolum -p tcp --dport 1337"; target = "ACCEPT"; } # zigbee2mqtt frontend
14 { predicate = "-i wiregrill -p tcp --dport 8123"; target = "ACCEPT"; } # hass
15 ];
16
17 # TODO add auto update
18 virtualisation.oci-containers = {
19 backend = "podman";
20 containers.homeassistant = {
21 volumes = [ "home-assistant:/config" ];
22 environment.TZ = "Europe/Berlin";
23 image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
24 extraOptions = [
25 "--network=host"
26 ];
27 };
28 };
29
30 services.mosquitto = {
31 enable = true;
32 listeners = [{
33 acl = [ ];
34 users.gg23 = { acl = [ "readwrite #" ]; password = "gg23-mqtt"; };
35 }];
36 };
37
38 environment.systemPackages = [ pkgs.mosquitto ];
39}