102 lines
2.5 KiB
Nix
102 lines
2.5 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
syncthingFolderBase = "${config.home.homeDirectory}/"; # default sync dir
|
|
cfg = config.homeModules.syncthing;
|
|
in
|
|
|
|
lib.mkIf cfg.enable {
|
|
services.syncthing = {
|
|
enable = true;
|
|
tray = {
|
|
enable = true;
|
|
package = pkgs.syncthingtray; # optional: GUI tray indicator
|
|
};
|
|
guiAddress = "127.0.0.1:8384";
|
|
settings = {
|
|
# get id with: syncthing --device-id
|
|
devices = {
|
|
t440p = {
|
|
id = "DEVICE-ID-T440P"; # replace with actual Syncthing device ID
|
|
name = "ThinkPad T440p";
|
|
};
|
|
steamdeck = {
|
|
id = "DEVICE-ID-STEAMDECK"; # replace with actual device ID
|
|
name = "SteamDeck";
|
|
};
|
|
xaorus = {
|
|
id = "4XQWZB6-OTRCS2M-QOZ4HYK-KEKBARC-X7ELITX-HF4RZA2-X7NFK74-VBI4BAU";
|
|
name = "Xaorus";
|
|
introducer = true;
|
|
};
|
|
};
|
|
|
|
folders = {
|
|
"logseq" = {
|
|
enable = true;
|
|
path = "${syncthingFolderBase}/logseq";
|
|
devices = [ "t440p" "steamdeck" "xaorus" ];
|
|
label = "LogSeq";
|
|
fsWatcherEnabled = true;
|
|
rescanInterval = 60;
|
|
ignorePerms = true;
|
|
ignore = [
|
|
"*.swp"
|
|
".cache"
|
|
];
|
|
versioning = {
|
|
type = "trashcan";
|
|
params.cleanoutDays = "1000";
|
|
};
|
|
};
|
|
|
|
"projects" = {
|
|
path = "${syncthingFolderBase}/projects";
|
|
devices = [ "t440p" "xaorus" ];
|
|
label = "Projects";
|
|
ignorePerms = true;
|
|
versioning = null;
|
|
ignore = [
|
|
".stversions"
|
|
".git"
|
|
"node_modules"
|
|
"target"
|
|
"*.lock"
|
|
"dist"
|
|
"out"
|
|
".DS_Store"
|
|
"thumbs.db"
|
|
];
|
|
};
|
|
|
|
# PublicMemes
|
|
|
|
#"screenshots" = {
|
|
# path = "${syncthingFolderBase}/screenshots";
|
|
# devices = [ "steamdeck" ];
|
|
# label = "Screenshots";
|
|
#};
|
|
};
|
|
|
|
options = {
|
|
urAccepted = -1; # telemetry disabled
|
|
listenAddresses = [
|
|
"tcp://0.0.0.0:22000"
|
|
"quic://0.0.0.0:22000"
|
|
];
|
|
globalAnnounceEnabled = false;
|
|
localAnnounceEnabled = true;
|
|
relaysEnabled = true;
|
|
natEnabled = true;
|
|
startBrowser = false;
|
|
autoAcceptFolders = false;
|
|
maxFolderConcurrency = 3;
|
|
minHomeDiskFree = {
|
|
unit = "%";
|
|
value = 3;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|