52 lines
1.2 KiB
Nix
52 lines
1.2 KiB
Nix
#
|
|
# All-device synchronization via Syncthing.
|
|
#
|
|
{ is-droid, ... }:
|
|
let
|
|
# The list of devices and their IDs.
|
|
devices = {
|
|
"valere" = { id = "VLZYF6C-OHG66RM-O72IMW3-S35YWAV-TYFJJVU-KAMJR7G-2XRLCVB-XOY6IAG"; };
|
|
"design" = { id = "XLTC5OX-3ZU6CYZ-MJ7TAY7-ZAMRIE4-SS2JWFB-FC3RJIO-B3BIQFV-J7U53QK"; };
|
|
"trailblazer" = { id = "JASHWW7-AYYTQLN-QZ6OEOX-EZK4GPA-OYW5IZS-5KAIIVR-MMXMCHL-OERDBQ2"; };
|
|
};
|
|
|
|
in
|
|
{
|
|
services.syncthing = {
|
|
enable = !is-droid;
|
|
openDefaultPorts = true;
|
|
|
|
# Run as our user, and adopt our permissions.
|
|
user = "deprekated";
|
|
|
|
# Primary configuration.
|
|
settings = {
|
|
|
|
# Set up the webUI, accessible only via localhost.
|
|
gui = {
|
|
enabled = true;
|
|
address = "tcp://127.0.0.1:8384";
|
|
};
|
|
|
|
# Set up the devices that we allow to connect.
|
|
# See the big table above.
|
|
inherit devices;
|
|
|
|
# Set op our main sync'd folder.
|
|
folders."synced" = {
|
|
path = "/home/deprekated/synced";
|
|
devices = builtins.attrNames devices;
|
|
|
|
# Treat this like a sync'd folder that we always have acess to.
|
|
ignorePerms = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
# Extra config passed through the environment.
|
|
systemd.services.syncthing.environment = {
|
|
STNODEFAULTFOLDER = "true";
|
|
};
|
|
|
|
}
|