add Media folder to syncthing

This commit is contained in:
Yan Lin 2026-01-10 09:59:22 +01:00
parent e02fba4277
commit d9febef05b
2 changed files with 23 additions and 2 deletions

View file

@ -141,6 +141,7 @@ let
todoEnabled = true; todoEnabled = true;
autoCompactEnabled = true; autoCompactEnabled = true;
alwaysThinkingEnabled = true; alwaysThinkingEnabled = true;
surveyDisabled = true;
permissions = defaultPermissions; permissions = defaultPermissions;
}; };

View file

@ -34,12 +34,21 @@ let
cleanInterval = "3600"; # Clean every hour cleanInterval = "3600"; # Clean every hour
}; };
}; };
liteVersioning = {
type = "staggered";
params = {
maxAge = "2592000"; # 30 days in seconds
cleanInterval = "3600"; # Clean every hour
};
};
in 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" "Archive" ]; default = [ "Credentials" "Documents" "Archive" "Media" ];
description = "List of Syncthing folders to enable for this host."; description = "List of Syncthing folders to enable for this host.";
}; };
enableGui = lib.mkOption { enableGui = lib.mkOption {
@ -104,10 +113,18 @@ in
versioning = commonVersioning; versioning = commonVersioning;
}; };
}) })
// (lib.optionalAttrs (lib.elem "Media" cfg.enabledFolders) {
"Media" = {
path = "~/Media";
devices = allDevices;
ignorePerms = true;
versioning = liteVersioning;
};
})
// (lib.optionalAttrs (lib.elem "Archive" cfg.enabledFolders) { // (lib.optionalAttrs (lib.elem "Archive" cfg.enabledFolders) {
"Archive" = { "Archive" = {
path = "~/Archive"; path = "~/Archive";
devices = pcDevices ++ touchDevices; devices = allDevices;
ignorePerms = true; ignorePerms = true;
versioning = commonVersioning; versioning = commonVersioning;
}; };
@ -145,6 +162,9 @@ in
(lib.mkIf (lib.elem "Documents" cfg.enabledFolders) { (lib.mkIf (lib.elem "Documents" cfg.enabledFolders) {
"Documents/.stignore".text = stignoreContent; "Documents/.stignore".text = stignoreContent;
}) })
(lib.mkIf (lib.elem "Media" cfg.enabledFolders) {
"Media/.stignore".text = stignoreContent;
})
(lib.mkIf (lib.elem "Archive" cfg.enabledFolders) { (lib.mkIf (lib.elem "Archive" cfg.enabledFolders) {
"Archive/.stignore".text = stignoreContent; "Archive/.stignore".text = stignoreContent;
}) })