add ignore to syncthing

This commit is contained in:
Yan Lin 2025-10-17 10:49:13 +02:00
parent f8e06b100a
commit aef4905355

View file

@ -1,5 +1,29 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
# Common ignore patterns for all synced folders
commonIgnores = [
".DS_Store"
"*.tmp"
"*.temp"
"~*"
".*.swp"
".*.swo"
"*~"
".Trash-*"
"Thumbs.db"
"desktop.ini"
];
# Common versioning configuration
commonVersioning = {
type = "staggered";
params = {
maxAge = "15552000"; # 180 days in seconds
cleanInterval = "3600"; # Clean every hour
};
};
in
{ {
# Enable Syncthing service # Enable Syncthing service
services.syncthing = { services.syncthing = {
@ -40,37 +64,22 @@
path = "~/Credentials"; path = "~/Credentials";
devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ]; devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ];
ignorePerms = true; ignorePerms = true;
versioning = { ignores = commonIgnores;
type = "staggered"; versioning = commonVersioning;
params = {
maxAge = "15552000"; # 180 days in seconds
cleanInterval = "3600"; # Clean every hour
};
};
}; };
"Documents" = { "Documents" = {
path = "~/Documents"; path = "~/Documents";
devices = [ "mba" "imac" "hs" "thinkpad" ]; devices = [ "mba" "imac" "hs" "thinkpad" ];
ignorePerms = true; ignorePerms = true;
versioning = { ignores = commonIgnores;
type = "staggered"; versioning = commonVersioning;
params = {
maxAge = "15552000"; # 180 days in seconds
cleanInterval = "3600"; # Clean every hour
};
};
}; };
"Obsidian" = { "Obsidian" = {
path = "~/Obsidian"; path = "~/Obsidian";
devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ]; devices = [ "mba" "imac" "iphone" "hs" "thinkpad" ];
ignorePerms = true; ignorePerms = true;
versioning = { ignores = commonIgnores;
type = "staggered"; versioning = commonVersioning;
params = {
maxAge = "15552000"; # 180 days in seconds
cleanInterval = "3600"; # Clean every hour
};
};
}; };
}; };