fix syncthing ignore

This commit is contained in:
Yan Lin 2025-10-17 13:55:59 +02:00
parent aef4905355
commit cddf7af3b5

View file

@ -15,6 +15,9 @@ let
"desktop.ini" "desktop.ini"
]; ];
# Convert ignore list to .stignore file content
stignoreContent = lib.concatStringsSep "\n" commonIgnores;
# Common versioning configuration # Common versioning configuration
commonVersioning = { commonVersioning = {
type = "staggered"; type = "staggered";
@ -64,21 +67,18 @@ in
path = "~/Credentials"; path = "~/Credentials";
devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ]; devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ];
ignorePerms = true; ignorePerms = true;
ignores = commonIgnores;
versioning = commonVersioning; versioning = commonVersioning;
}; };
"Documents" = { "Documents" = {
path = "~/Documents"; path = "~/Documents";
devices = [ "mba" "imac" "hs" "thinkpad" ]; devices = [ "mba" "imac" "hs" "thinkpad" ];
ignorePerms = true; ignorePerms = true;
ignores = commonIgnores;
versioning = commonVersioning; versioning = commonVersioning;
}; };
"Obsidian" = { "Obsidian" = {
path = "~/Obsidian"; path = "~/Obsidian";
devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ]; devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ];
ignorePerms = true; ignorePerms = true;
ignores = commonIgnores;
versioning = commonVersioning; versioning = commonVersioning;
}; };
}; };
@ -106,6 +106,11 @@ in
config.RunAtLoad = true; config.RunAtLoad = true;
}; };
# Deploy .stignore files to synced folders
home.file."Credentials/.stignore".text = stignoreContent;
home.file."Documents/.stignore".text = stignoreContent;
home.file."Obsidian/.stignore".text = stignoreContent;
# For NixOS systems, we need to add Syncthing as a manual service in Traefik # For NixOS systems, we need to add Syncthing as a manual service in Traefik
# Since Syncthing runs as a systemd service (not container), we'll handle routing via static config # Since Syncthing runs as a systemd service (not container), we'll handle routing via static config
# or create a container wrapper for it to use with service discovery # or create a container wrapper for it to use with service discovery