{ config, pkgs, lib, ... }: { custom.samba-share = { enable = true; folders = { movies = config.test.services.syncthing.declarative.folders.movies.path; series = config.test.services.syncthing.declarative.folders.series.path; samples = config.test.services.syncthing.declarative.folders.samples.path; music = config.test.services.syncthing.declarative.folders.music-library.path; }; }; test.services.syncthing = { enable = true; openDefaultPorts = false; dataDir = "/home/syncthing"; configDir = "/home/syncthing"; declarative = { cert = toString ; key = toString ; overrideFolders = true; folders = { # on encrypted hard drive # ----------------------- private = { enable = true; path = "/home/syncthing/private"; versioning = { type = "simple"; params.keep = "10"; }; }; desktop = { enable = true; path = "/home/syncthing/desktop"; }; finance = { enable = true; path = "/home/syncthing/finance"; versioning = { type = "simple"; params.keep = "10"; }; }; fotos = { enable = true; path = "/home/syncthing/fotos"; versioning = { type = "simple"; params.keep = "10"; }; }; lost-fotos = { enable = true; path = "/home/syncthing/lost-fotos.ct"; }; music-projects = { enable = true; path = "/home/syncthing/music-projects"; }; zettlr = { enable = true; path = "/home/syncthing/zettlr"; versioning = { type = "simple"; params.keep = "10"; }; }; # on media hard drive (not encrypted) # ----------------------------------- video-material = { enable = true; path = "/home/syncthing/video-material"; }; music-library-free = { enable = true; path = "/media/syncthing/music-library-free"; rescanInterval = 8 * 3600; }; porn = { enable = true; path = "/media/syncthing/porn"; rescanInterval = 8 * 3600; }; samples = { enable = true; path = "/media/syncthing/samples"; rescanInterval = 8 * 3600; versioning = { type = "simple"; params.keep = "10"; }; }; movies = { enable = true; path = "/media/syncthing/movies"; rescanInterval = 8 * 3600; versioning = { type = "simple"; params.keep = "10"; }; }; music-library = { enable = true; path = "/media/syncthing/music-library"; rescanInterval = 8 * 3600; versioning = { type = "simple"; params.keep = "10"; }; }; series = { enable = true; path = "/media/syncthing/series"; rescanInterval = 8 * 3600; versioning = { type = "simple"; params.keep = "10"; }; }; smartphone-folder = { enable = true; path = "/media/syncthing/smartphone-folder"; rescanInterval = 8 * 3600; versioning = { type = "simple"; params.keep = "10"; }; }; }; }; }; # todo now working properly # ------------------------- #systemd.services."permown._media_syncthing" = { # bindsTo = [ "media.mount" ]; # after = [ "media.mount" ]; #}; #system.permown."/media/syncthing" = { # owner = "syncthing"; # group = "syncthing"; # umask = "0002"; #}; systemd.services."syncthing" = { bindsTo = [ "media.mount" ]; after = [ "media.mount" ]; }; backup.all.restic.dirs = [ "/home/syncthing/finance" ]; }