about summary refs log tree commit diff
path: root/machines/srv3/home-assistant.nix
blob: d8a4d1d418a76df608d3d5e88b8198b17dd11b7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ pkgs, ... }:
{
  virtualisation.oci-containers = {
    backend = "docker";
    containers.homeassistant = {
      volumes = [ 
        "/srv/home-assistant:/config"
	"/etc/localtime:/etc/localtime:ro"
	"/run/dbus:/run/dbus:ro"
      ];
      environment.TZ = "Europe/Warsaw";
      image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
      extraOptions = [ 
        "--network=host" 
      ];
      autoStart = true;
    };
  };
  networking.firewall.allowedTCPPorts = [ 8123 ];
}