about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-10-30 19:28:28 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2024-10-30 19:28:28 +0100
commit9c14b06fc484e4be8852c4f379cb1671ed367d6a (patch)
treeac54591e1ee05ee57c69627630bb80ff6ed24eb2
parenta0b92062d9e3049b96ed9f64b35f71ed3064e163 (diff)
parentb813c1f7aa010862607558d70e6275bbdd111412 (diff)
downloaddots-9c14b06fc484e4be8852c4f379cb1671ed367d6a.tar.gz
dots-9c14b06fc484e4be8852c4f379cb1671ed367d6a.zip
Merge branch 'master' of github.com:pniedzwiedzinski/dots
-rw-r--r--machines/srv3/configuration.nix5
-rw-r--r--machines/srv3/home-assistant.nix20
-rw-r--r--machines/srv3/webdav.nix33
3 files changed, 58 insertions, 0 deletions
diff --git a/machines/srv3/configuration.nix b/machines/srv3/configuration.nix
index 7e157ff..ae54e48 100644
--- a/machines/srv3/configuration.nix
+++ b/machines/srv3/configuration.nix
@@ -11,7 +11,9 @@ in
     imports =
       [
       ../../modules/obsidian-livesync.nix
+      ./home-assistant.nix
       ./hardware-configuration.nix
+      ./webdav.nix
       ./cgit.nix
       ./noip.nix
     ];
@@ -165,6 +167,9 @@ in
           autoindex on;
         }
       '';
+      locations."/harcdzielnia/" = {
+        return = "301 https://harcdzielnia.niedzwiedzinski.cyou";
+      };
     };
     "help.niedzwiedzinski.cyou" = {
       enableACME = true;
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 ];
+}
diff --git a/machines/srv3/webdav.nix b/machines/srv3/webdav.nix
new file mode 100644
index 0000000..9a4c126
--- /dev/null
+++ b/machines/srv3/webdav.nix
@@ -0,0 +1,33 @@
+{ pkgs, ... }:
+let
+	port = "6060";
+in
+{
+	services.nginx.virtualHosts."files.niedzwiedzinski.cyou" = {
+		forceSSL = true;
+		enableACME = true;
+
+		locations."/" = {
+			proxyPass = "http://localhost:${port}";
+		};
+	};
+
+	services.webdav = {
+		enable = true;
+		configFile = "/etc/webdav.yaml";
+		#settings = {
+			#address = "0.0.0.0";
+			#port = port;
+			#scope = "/srv/files";
+			#modify = true;
+			#auth = true;
+			#users = [
+			#{
+				#username = "patryk";
+				#password = "test";
+			#}
+			#];
+		#};
+	};
+
+}