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