about summary refs log tree commit diff
path: root/machines/srv3/home-assistant.nix
diff options
context:
space:
mode:
Diffstat (limited to 'machines/srv3/home-assistant.nix')
-rw-r--r--machines/srv3/home-assistant.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/machines/srv3/home-assistant.nix b/machines/srv3/home-assistant.nix
new file mode 100644
index 0000000..d8a4d1d
--- /dev/null
+++ b/machines/srv3/home-assistant.nix
@@ -0,0 +1,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 ];
+}