nix-git/hosts/yodaNas/syncthing.nix

69 lines
2.9 KiB
Nix
Raw Permalink Normal View History

2023-11-28 15:21:03 +01:00
# https://nixos.wiki/wiki/Syncthing
2024-01-02 11:19:52 +01:00
# Manually create syncthing.settings.folders.<name>.path and chown it to user/group `syncthing`
2023-11-28 15:21:03 +01:00
# before starting the Syncthing service.
# You can get your device id with:
# sudo cat /var/lib/syncthing/.config/syncthing/config.xml | grep 'device id="'
{ config, pkgs, ... }:
{
2024-01-13 12:59:37 +01:00
# Create user/group to be used by services.syncthing.user/group setting.
users.users."www-data" = {
group = "www-data";
uid = 82;
};
users.groups."www-data".gid = 82;
2023-11-28 15:21:03 +01:00
services = {
syncthing = {
enable = true;
2024-01-13 12:59:37 +01:00
# Optionally change user and group.
# This can be useful if your data directories shall belong to a different user/group.
user = "82"; # Default: syncthing
group = "82"; # Default: syncthing
2023-11-28 15:21:03 +01:00
# Whether to open the default ports in the firewall: TCP/UDP 22000 for transfers and UDP 21027 for discovery.
2023-12-12 16:40:31 +01:00
# With this enabled, the connection type of other syncthing clients in the same WiFi/LAN is "TCP LAN" and not "WAN Relay".
openDefaultPorts = true;
2023-11-28 15:21:03 +01:00
overrideDevices = true; # overrides any devices added or deleted through the WebUI
overrideFolders = true; # overrides any folders added or deleted through the WebUI
2024-01-22 13:55:36 +01:00
settings.devices = {
2023-11-28 15:21:03 +01:00
"yodaTux" = { id = "AKAIZ66-G67WC4J-WEYBOGF-TNXWBT3-BCSETRQ-2BEHCT7-GSZQRWP-IGXKSQK"; };
2023-11-29 15:00:54 +01:00
"yodaTab" = { id = "WKVVVEY-P7QCRKU-HO4QHHM-B4H5NC2-I3UG2TU-UEIUACZ-ZJEAVUY-4Q6FVQV"; };
2024-11-14 16:04:48 +01:00
"yodaEnchilada" = { id = "UFLO2X5-3TFPLQM-GEKIQ27-75U3UP4-7OKBEV5-KNXLVBG-7Y5VFY6-DKDRAAN"; };
2024-11-13 08:29:29 +01:00
"yodaA5xelte" = { id = "VYIC3PU-DUISUJT-BRFEDUB-BVGYK5W-M37ZH4I-S7DWWWA-LMBVPST-BJFL6Q5"; };
2024-01-06 21:49:44 +01:00
"susanLaptop" = { id = "5VT2TZP-FCSREZY-BQTLWHP-VGYAQE3-A3HXOC2-N3S75Z2-TUFJWRZ-HHPQJQW"; };
"susanHandy" = { id = "VEIKGQM-WVEQ2L2-RZQ5PHD-QII5N6D-42COGCA-NHICJKY-OX4LRRI-O3A7MAH"; };
2024-07-07 13:36:18 +02:00
"sarahHandy" = { id = "VBRXT7I-7TR7KOZ-YEZFSZY-D7IEBDC-5V6TFUU-7HD2MOF-T6DYWDZ-LDHH7QK"; };
2023-11-28 15:21:03 +01:00
};
2024-01-02 11:19:52 +01:00
settings.folders = {
2023-11-28 15:21:03 +01:00
# Name of folder in Syncthing, also the folder ID.
2024-07-07 13:36:18 +02:00
# My personal Obsidian vault.
2023-11-28 15:21:03 +01:00
"Notes" = {
# Path to shared folder.
2024-01-13 12:59:37 +01:00
path = "/mnt/data/jc-data/cloud.privacy1st.de/files_ncp/Notes";
2023-11-28 15:21:03 +01:00
# Which devices to share the folder with.
2024-11-13 08:29:29 +01:00
devices = [ "yodaTux" "yodaTab" "yodaEnchilada" "yodaA5xelte" ];
2023-11-28 15:21:03 +01:00
};
2024-11-05 22:04:31 +01:00
# My personal tasklist.
"Tasks" = {
path = "/mnt/data/jc-data/cloud.privacy1st.de/files_ncp/Tasks";
2024-11-13 08:29:29 +01:00
devices = [ "yodaTux" "yodaTab" "yodaEnchilada" "yodaA5xelte" ];
2024-11-05 22:04:31 +01:00
};
2024-07-07 13:36:18 +02:00
# Obsidian vault of travel blog.
"TravelDiary" = {
path = "/mnt/data/jc-data/cloud.privacy1st.de/files_ncp/TravelDiary";
2024-08-16 12:35:52 +02:00
devices = [ "yodaTux" "sarahHandy" ];
2024-07-07 13:36:18 +02:00
};
# Obsidian vault of Susan.
2024-01-06 21:49:44 +01:00
"Obsidian" = {
2024-01-13 12:59:37 +01:00
path = "/mnt/data/jc-data/cloud.privacy1st.de/files_susan/Obsidian";
2024-01-06 21:49:44 +01:00
devices = [ "susanLaptop" "susanHandy" ];
};
2023-11-28 15:21:03 +01:00
};
};
};
}