Add syncthing
This commit is contained in:
parent
355bd0593d
commit
34e8027554
5 changed files with 74 additions and 21 deletions
|
|
@ -1,15 +1,67 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Enable Syncthing service with auto-start on macOS
|
||||
# Enable Syncthing service
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
# Don't enable tray on macOS as it requires additional setup
|
||||
# Don't enable tray on server (Linux) or macOS
|
||||
tray.enable = false;
|
||||
|
||||
# Listen on all interfaces for the GUI
|
||||
guiAddress = "0.0.0.0:8384";
|
||||
|
||||
# Declarative configuration - will override any GUI changes
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
settings = {
|
||||
# Define all devices
|
||||
devices = {
|
||||
"ipad" = {
|
||||
id = "HPZUOHZ-VMKK246-RBIEHD6-SFTA5DD-2U5LFMX-LXQBGTI-N4C6Z5F-ZVIR6A4";
|
||||
};
|
||||
"mba" = {
|
||||
id = "MRLK24K-BIZSXHQ-TORQTV3-RN6ZBTL-Q5CVXWJ-U3ZJM2J-XGEAQBQ-JFPFUQE";
|
||||
};
|
||||
"iphone" = {
|
||||
id = "NMWI5MP-J4FC4A6-SDDXZPD-G66TJCO-2W7KGFD-RJWQ53U-I7GUVWP-WHF4QQO";
|
||||
};
|
||||
"imac" = {
|
||||
id = "5FVPJMW-ZK2NSM7-H747PTY-XWOJPHC-MBJZWJW-WKAB5BE-KSMQAXQ-QQP6JAG";
|
||||
};
|
||||
};
|
||||
|
||||
# Define shared folders
|
||||
folders = {
|
||||
"Credentials" = {
|
||||
path = "~/Credentials";
|
||||
devices = [ "ipad" "mba" "iphone" "imac" ];
|
||||
ignorePerms = true;
|
||||
};
|
||||
"Documents" = {
|
||||
path = "~/Documents";
|
||||
devices = [ "mba" "imac" ];
|
||||
ignorePerms = true;
|
||||
};
|
||||
"Obsidian" = {
|
||||
path = "~/Obsidian";
|
||||
devices = [ "ipad" "mba" "iphone" "imac" ];
|
||||
ignorePerms = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Additional settings
|
||||
options = {
|
||||
urAccepted = -1; # Disable usage reporting
|
||||
relaysEnabled = true;
|
||||
localAnnounceEnabled = true;
|
||||
globalAnnounceEnabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Override the launchd agent to add RunAtLoad on macOS
|
||||
launchd.agents.syncthing = lib.mkIf (pkgs.stdenv.isDarwin && config.services.syncthing.enable) {
|
||||
config.RunAtLoad = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue