This repository has no description
1.4 kB
53 lines
1{ config, pkgs, ... }:
2{
3 imports = [
4 ./zigbee.nix
5 ];
6
7 # Runs on the gg23 router: the LAN (int0) is a trusted interface there
8 # (configs/gg23.nix), et0 is the WAN and stays closed.
9 networking.firewall.interfaces = {
10 retiolum.allowedTCPPorts = [
11 8123 # hass
12 1337 # zigbee2mqtt frontend
13 ];
14 wiregrill.allowedTCPPorts = [ 8123 ]; # hass
15 zttzibeakb.allowedTCPPorts = [ 8123 ]; # hass
16 };
17
18 systemd.services.hass-update = {
19 startAt = "daily";
20 script = ''
21 ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.homeassistant.image}
22 systemctl restart podman-homeassistant.service
23 ${pkgs.podman}/bin/podman system prune -a --volumes -f
24 '';
25 };
26
27 virtualisation.oci-containers = {
28 backend = "podman";
29 containers.homeassistant = {
30 volumes = [ "home-assistant:/config" ];
31 environment.TZ = "Europe/Berlin";
32 image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
33 extraOptions = [
34 "--network=host"
35 ];
36 };
37 };
38
39 services.mosquitto = {
40 enable = true;
41 listeners = [
42 {
43 acl = [ ];
44 users.gg23 = {
45 acl = [ "readwrite #" ];
46 password = "gg23-mqtt";
47 };
48 }
49 ];
50 };
51
52 environment.systemPackages = [ pkgs.mosquitto ];
53}