Add Archive syncthing directory

This commit is contained in:
Yan Lin 2025-11-18 18:49:56 +01:00
parent b69ba0c1ff
commit 6ff52fda4f

View file

@ -34,8 +34,8 @@ in
options.syncthing-custom = { options.syncthing-custom = {
enabledFolders = lib.mkOption { enabledFolders = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
default = [ "Credentials" "Documents" "Obsidian" ]; default = [ "Credentials" "Documents" "Obsidian" "Archive" ];
description = "List of Syncthing folders to enable for this host. Available: Credentials, Documents, Obsidian"; description = "List of Syncthing folders to enable for this host.";
}; };
}; };
@ -98,6 +98,14 @@ in
ignorePerms = true; ignorePerms = true;
versioning = commonVersioning; versioning = commonVersioning;
}; };
})
// (lib.optionalAttrs (lib.elem "Archive" cfg.enabledFolders) {
"Archive" = {
path = "~/Archive";
devices = [ "iphone" "hs" "thinkpad" "ipad" "macbook" ];
ignorePerms = true;
versioning = commonVersioning;
};
}); });
# GUI settings with authentication # GUI settings with authentication
@ -134,6 +142,9 @@ in
(lib.mkIf (lib.elem "Obsidian" cfg.enabledFolders) { (lib.mkIf (lib.elem "Obsidian" cfg.enabledFolders) {
"Obsidian/.stignore".text = stignoreContent; "Obsidian/.stignore".text = stignoreContent;
}) })
(lib.mkIf (lib.elem "Archive" cfg.enabledFolders) {
"Archive/.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