summaryrefslogtreecommitdiff
path: root/hosts/local/syncthing.nix
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-10-25 21:07:06 +0700
committerpolwex <polwex@sortug.com>2025-10-25 21:07:06 +0700
commitdcf6ad1c5755e5acc40b3aa88315f7c335c7eb55 (patch)
treeb991cb97dfb6992d020b6d6a8f4442f329b18c56 /hosts/local/syncthing.nix
parent021a797c8116032a114ba78476d1769c55479b48 (diff)
p16p16
Diffstat (limited to 'hosts/local/syncthing.nix')
-rw-r--r--hosts/local/syncthing.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/hosts/local/syncthing.nix b/hosts/local/syncthing.nix
new file mode 100644
index 0000000..5497bc9
--- /dev/null
+++ b/hosts/local/syncthing.nix
@@ -0,0 +1,54 @@
+{
+ inputs,
+ pkgs,
+ ...
+}: {
+ services.syncthing = {
+ enable = true;
+ openDefaultPorts = true;
+ user = "y";
+ dataDir = "/home/y/sync"; # default location for new folders
+ # configDir = "/home/myusername/.config/syncthing";
+ key = "/home/y/sync/key.pem";
+ cert = "/home/y/sync/cert.pem";
+ settings = {
+ devices = {
+ "phone" = {id = "TOBQJTK-QWVMMCN-7SJWXTL-FUKM4FB-ZTLGEL7-KEBTTB3-PC3WZOO-FLBW5A2 ";};
+ "laptop" = {id = "INHTOYO-WNCIVPD-M27N2DY-2PJWVCV-FWYOCTQ-AWHBVIJ-4PRVAWR-E7PUTQ4";};
+ # "desktop" = {id = "DEVICE-ID-GOES-HERE";};
+ };
+ folders = {
+ "memes" = {
+ path = "/home/y/sync/memes";
+ devices = ["phone" "laptop"];
+ };
+ "creds" = {
+ path = "/home/y/sync/creds";
+ devices = ["phone" "laptop"];
+ # By default, Syncthing doesn't sync file permissions. This line enables it for this folder.
+ # ignorePerms = false;
+ };
+ "docs" = {
+ path = "/home/y/sync/docs";
+ devices = ["phone" "laptop"];
+ };
+ # "Sensitive" = {
+ # path = "/home/myusername/Sensitive";
+ # devices = [
+ # # We trust this device to have access
+ # # to the decrypted contents of this folder.
+ # "device1"
+ # # We do not trust this device, but we want to have another
+ # # (encrypted) copy of the data for redundancy/backup/sync purposes.
+ # {
+ # name = "device2";
+ # # encryptionPasswordFile is a path to a file containing the encryption password.
+ # # See below for information about managing secrets on NixOS.
+ # encryptionPasswordFile = "/run/secrets/st-sensitive-password";
+ # }
+ # ];
+ # };
+ };
+ };
+ };
+}