From 83c01a421d962caa155928948d682fde6e5ea7f4 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Tue, 31 Dec 2024 10:47:24 -0800 Subject: [PATCH] Init syncthing --- .../desktop/services/syncthing.nix | 6 +++ dotfiles/nixos/desktop/services/syncthing.nix | 43 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 dotfiles/home-manager/desktop/services/syncthing.nix create mode 100644 dotfiles/nixos/desktop/services/syncthing.nix diff --git a/dotfiles/home-manager/desktop/services/syncthing.nix b/dotfiles/home-manager/desktop/services/syncthing.nix new file mode 100644 index 00000000..9cff52e7 --- /dev/null +++ b/dotfiles/home-manager/desktop/services/syncthing.nix @@ -0,0 +1,6 @@ +{ ... }: { + services.syncthing = { + enable = false; + tray = true; + }; +} diff --git a/dotfiles/nixos/desktop/services/syncthing.nix b/dotfiles/nixos/desktop/services/syncthing.nix new file mode 100644 index 00000000..dca9e32d --- /dev/null +++ b/dotfiles/nixos/desktop/services/syncthing.nix @@ -0,0 +1,43 @@ +{ vars, ... }: { + networking.firewall = { + allowedTCPPorts = [ 8384 22000 ]; + allowedUDPPorts = [ 22000 21027 ]; + }; + services.syncthing = { + enable = false; + group = "users"; + user = "${vars.user.username}"; + configDir = /home/${vars.user.username}/.config/syncthing; + overrideDevices = false; + overrideFolders = false; + settings = { + devices = { + #"server" = { id = ""; }; + "phone" = { id = "JJNURBH-YHHCPGJ-6I6YKE4-4CLD35N-LWA3JAV-KUPNYBO-I7Q4ZHY-FR3RNAU"; }; + #"laptop" = { id = ""; }; + }; + folders = { + "Documents" = { + path = "~/Documents/"; + devices = [ "phone" ]; + }; + "Pictures" = { + path = "~/Pictures/"; + devices = [ "phone" ]; + }; + "Videos" = { + path = "~/Videos/"; + devices = [ "phone" ]; + }; + "Emulators" = { + path = "~/Emulators/"; + devices = [ "phone" ]; + }; + "Backups" = { + path = "~/Backups/"; + devices = []; + }; + }; + }; + }; +}