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