revise syncthing config

This commit is contained in:
Yan Lin 2025-11-23 16:54:45 +01:00
parent a14af7dbb4
commit a9dc71ffb7

View file

@ -21,6 +21,11 @@ let
# Convert ignore list to .stignore file content # Convert ignore list to .stignore file content
stignoreContent = lib.concatStringsSep "\n" commonIgnores; stignoreContent = lib.concatStringsSep "\n" commonIgnores;
# Device groupings
pcDevices = [ "hs" "thinkpad" "macbook" ];
touchDevices = [ "iphone" "ipad" ];
allDevices = pcDevices ++ touchDevices;
# Common versioning configuration # Common versioning configuration
commonVersioning = { commonVersioning = {
type = "staggered"; type = "staggered";
@ -78,7 +83,7 @@ in
(lib.optionalAttrs (lib.elem "Credentials" cfg.enabledFolders) { (lib.optionalAttrs (lib.elem "Credentials" cfg.enabledFolders) {
"Credentials" = { "Credentials" = {
path = "~/Credentials"; path = "~/Credentials";
devices = [ "iphone" "hs" "thinkpad" "ipad" "macbook" ]; devices = allDevices;
ignorePerms = true; ignorePerms = true;
versioning = commonVersioning; versioning = commonVersioning;
}; };
@ -86,7 +91,7 @@ in
// (lib.optionalAttrs (lib.elem "Documents" cfg.enabledFolders) { // (lib.optionalAttrs (lib.elem "Documents" cfg.enabledFolders) {
"Documents" = { "Documents" = {
path = "~/Documents"; path = "~/Documents";
devices = [ "hs" "thinkpad" "macbook" ]; devices = pcDevices;
ignorePerms = true; ignorePerms = true;
versioning = commonVersioning; versioning = commonVersioning;
}; };
@ -94,7 +99,7 @@ in
// (lib.optionalAttrs (lib.elem "Obsidian" cfg.enabledFolders) { // (lib.optionalAttrs (lib.elem "Obsidian" cfg.enabledFolders) {
"Obsidian" = { "Obsidian" = {
path = "~/Obsidian"; path = "~/Obsidian";
devices = [ "hs" "thinkpad" "macbook" ]; devices = pcDevices;
ignorePerms = true; ignorePerms = true;
versioning = commonVersioning; versioning = commonVersioning;
}; };
@ -102,7 +107,7 @@ in
// (lib.optionalAttrs (lib.elem "Archive" cfg.enabledFolders) { // (lib.optionalAttrs (lib.elem "Archive" cfg.enabledFolders) {
"Archive" = { "Archive" = {
path = "~/Archive"; path = "~/Archive";
devices = [ "iphone" "hs" "thinkpad" "ipad" "macbook" ]; devices = allDevices;
ignorePerms = true; ignorePerms = true;
versioning = commonVersioning; versioning = commonVersioning;
}; };