add DCIM to syncthing folders

This commit is contained in:
Yan Lin 2026-02-14 16:20:58 +01:00
parent 57a556de0f
commit ece42bc5c9
3 changed files with 7 additions and 3 deletions

View file

@ -13,6 +13,7 @@
Documents = { enable = true; maxAgeDays = 30; }; Documents = { enable = true; maxAgeDays = 30; };
Media = { enable = true; maxAgeDays = 7; }; Media = { enable = true; maxAgeDays = 7; };
Archive = { enable = true; maxAgeDays = 30; }; Archive = { enable = true; maxAgeDays = 30; };
DCIM = { enable = true; maxAgeDays = 7; path = "/mnt/essd/DCIM" };
}; };
services.scheduled-commands.dcim-consume = { services.scheduled-commands.dcim-consume = {

View file

@ -13,6 +13,7 @@
Documents = { enable = true; maxAgeDays = 30; }; Documents = { enable = true; maxAgeDays = 30; };
Media = { enable = true; maxAgeDays = 7; }; Media = { enable = true; maxAgeDays = 7; };
Archive = { enable = true; maxAgeDays = 30; }; Archive = { enable = true; maxAgeDays = 30; };
DCIM = { enable = true; maxAgeDays = 7; path = "~/DCIM" };
}; };
services.scheduled-commands.aicloud-backup = { services.scheduled-commands.aicloud-backup = {

View file

@ -6,9 +6,10 @@
let let
cfg = config.syncthing-custom; cfg = config.syncthing-custom;
pcDevices = [ "macbook" "imac" "thinkpad" "nfss" ]; pcDevices = [ "macbook" "imac" ];
serverDevices = [ "thinkpad" "nfss" ];
touchDevices = [ "iphone" "ipad" ]; touchDevices = [ "iphone" "ipad" ];
allDevices = pcDevices ++ touchDevices; allDevices = pcDevices ++ serverDevices ++ touchDevices;
mkFolderOptions = name: overrides: let mkFolderOptions = name: overrides: let
opts = { opts = {
@ -39,9 +40,10 @@ in
options.syncthing-custom = { options.syncthing-custom = {
folders = { folders = {
Credentials = mkFolderOptions "Credentials" {}; Credentials = mkFolderOptions "Credentials" {};
Documents = mkFolderOptions "Documents" { devices = pcDevices; }; Documents = mkFolderOptions "Documents" { devices = pcDevices ++ serverDevices; };
Media = mkFolderOptions "Media" { devices = lib.filter (d: d != "iphone") allDevices; }; Media = mkFolderOptions "Media" { devices = lib.filter (d: d != "iphone") allDevices; };
Archive = mkFolderOptions "Archive" {}; Archive = mkFolderOptions "Archive" {};
DCIM = mkFolderOptions "DCIM" { devices = serverDevices; };
}; };
enableGui = lib.mkOption { enableGui = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;