Fedir Zadniprovskyi 2024-06-03
chore: add lsyncd config
@133d38e62989a6a474c8eb25b4ff09025ef04e11
Taskfile.yaml
--- Taskfile.yaml
+++ Taskfile.yaml
@@ -19,7 +19,7 @@
     sources:
       - Dockerfile.*
       - faster_whisper_server/*.py
-  sync: lsyncd -nodaemon -delay 0 -rsyncssh . gpu-box faster-whisper-server
+  sync: lsyncd lsyncd.conf
   # Python's urllib3 takes forever when ipv6 is enabled
   # https://support.nordvpn.com/hc/en-us/articles/20164669224337-How-to-disable-IPv6-on-Linux
   disable-ipv6: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 && sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
flake.nix
--- flake.nix
+++ flake.nix
@@ -28,6 +28,7 @@
               pv
               pyright
               python311
+              rsync
               ruff
               websocat
             ];
 
lsyncd.conf (added)
+++ lsyncd.conf
@@ -0,0 +1,20 @@
+local host = os.getenv("SERVER_HOST")
+local dir = io.popen("basename $(pwd)"):read("*a"):gsub("\n", "")
+
+settings {
+    nodaemon = true
+}
+
+sync {
+    default.rsyncssh,
+    source = ".",
+    delay = 0,
+    host = host,
+    targetdir = dir,
+    excludeFrom = ".gitignore",
+    exclude = { ".git" },
+    rsync = {
+        archive = true, -- preserves permissions, symlinks, etc.
+        compress = true,
+    }
+}
Add a comment
List