This repository has been archived on 2024-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
nixos/modules/common-syncthing.nix
2023-12-01 15:00:02 +05:30

98 lines
2.4 KiB
Nix

{ config, ... }:
let
payas = "payas";
in
# TODO:
# - Setup certificates and keys declaratively? This will be a real possibility of depending on my SSH key for a whole lotta stuff. Perhaps keep that for future
# - Add more folders and devices in declarative way
# - Make ALL the nodes use this declaratively :)
{
services.syncthing = {
enable = true;
openDefaultPorts = true;
user = payas;
group = payas;
dataDir = "/home/${payas}";
configDir = config.services.syncthing.dataDir + "/.config/syncthing";
# Hosts can opt-out of folders with enable = false
# When adding new folders, you may want to create them first manually for permissions
# These should be configured per-node
# overrideFolders = true;
overrideDevices = false;
settings = {
options = {
urAccepted = -1;
relaysEnabled = true;
limitBandwidthInLan = false;
localAnnounceEnabled = true;
};
gui = {
theme = "black";
};
devices = {
hermes = {
id =
"DCG6TFN-JRO422C-AQWFNDT-CCT7KCX-ZXUL7OG-O5UGEC3-QPF5VWW-RNXU5Q4";
name = "hermes";
};
"Childish Tycoon" = {
id =
"ERSVP63-ASZCCJB-FWLSZ3N-MDZ4SV5-IXBP5QD-QK235LI-DY5BYRC-6NSWUQS";
name = "Childish Tycoon";
};
bebop = {
id =
"M6OJZSY-MPOQY76-BSZUFBQ-QK7LBM6-3YBOJZS-5H2K7UV-S6B34ON-THT3OAI";
name = "bebop";
};
phoebe = {
id = "QIYIN4H-YPFZBEC-BG27JXI-VZMTK52-PJCHLUP-KVICDTY-MC26CAS-D66LKQV";
name = "phoebe";
};
};
folders = {
# devices, type and versioning to be configured per-node
# Disable unwanted folder in per-node config
Keepass = {
id = "qsoil-jtfof";
label = "Keepass";
path = "~/Keepass";
};
Syncthing = {
id = "yg7in-0dlb8";
label = "Syncthing";
path = "~/Syncthing";
};
Music = {
id = "3qsnr-wjn9w";
label = "Music";
path = "~/Music";
};
org = {
id = "9ta3z-yrde3";
label = "org";
path = "~/org";
};
Pictures = {
id = "rjozc-vd3hh";
label = "Pictures";
path = "~/Pictures";
};
};
};
};
}