2022-06-26 15:34:21 +02:00
|
|
|
{ config, ... }:
|
|
|
|
{
|
2022-11-29 17:05:49 +01:00
|
|
|
sops.secrets."syncthing/key" = { };
|
|
|
|
sops.secrets."syncthing/cert" = { };
|
2022-06-26 15:34:21 +02:00
|
|
|
|
2023-09-02 18:27:51 +02:00
|
|
|
# make sure folders exist writable
|
|
|
|
systemd.tmpfiles.rules = [
|
2023-10-16 23:12:26 +02:00
|
|
|
"d /data/ 0755 syncthing syncthing"
|
|
|
|
"d /data/computer 0755 syncthing syncthing"
|
|
|
|
"d /data/phone 0755 syncthing syncthing"
|
|
|
|
"d /data/music 0755 syncthing syncthing"
|
|
|
|
"d /data/photos 0755 syncthing syncthing"
|
2023-09-02 18:27:51 +02:00
|
|
|
];
|
|
|
|
|
2022-06-26 15:34:21 +02:00
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
|
|
|
openDefaultPorts = true;
|
2022-11-29 17:05:49 +01:00
|
|
|
key = config.sops.secrets."syncthing/key".path;
|
|
|
|
cert = config.sops.secrets."syncthing/cert".path;
|
2022-06-26 15:34:21 +02:00
|
|
|
extraOptions = {
|
|
|
|
options = {
|
|
|
|
localAnnounceEnabled = false;
|
2023-01-12 23:21:42 +01:00
|
|
|
urAccepted = 3;
|
2022-06-26 15:34:21 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
devices = {
|
|
|
|
"thinkman" = {
|
|
|
|
id = "KXSCPX3-JCCFZM4-S2LQZZL-3AM6WRL-IPNWVG2-IB5FEDJ-YYFUIRR-VMDO3AL";
|
|
|
|
};
|
2022-07-03 10:51:43 +02:00
|
|
|
"birdman" = {
|
|
|
|
id = "34Z4J7W-MJIODUD-J6LDJY6-QILQLLB-CJ4GR7K-7TJM2K3-R7SIPRV-XQO5TAI";
|
|
|
|
};
|
2022-12-03 12:00:55 +01:00
|
|
|
"serverle" = {
|
|
|
|
id = "PVPEIN7-PI226LR-ULSBYKT-JGRQ3PS-WSPLGBP-TKYRJVP-OTWE7IV-NLKTBA3";
|
|
|
|
};
|
2022-06-26 15:34:21 +02:00
|
|
|
};
|
|
|
|
folders = {
|
2022-12-03 12:00:55 +01:00
|
|
|
"Computer" = {
|
|
|
|
id = "djdxo-1akub";
|
2023-10-16 23:12:26 +02:00
|
|
|
path = "/data/computer";
|
2022-12-03 12:00:55 +01:00
|
|
|
devices = [
|
|
|
|
"thinkman"
|
|
|
|
"birdman"
|
|
|
|
"serverle"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
"Phone" = {
|
|
|
|
id = "4hds7-gpypp";
|
2023-10-16 23:12:26 +02:00
|
|
|
path = "/data/phone";
|
2022-12-03 12:00:55 +01:00
|
|
|
devices = [
|
|
|
|
"thinkman"
|
|
|
|
"birdman"
|
|
|
|
"serverle"
|
|
|
|
];
|
|
|
|
};
|
2022-06-26 15:34:21 +02:00
|
|
|
"Music" = {
|
2022-07-03 10:51:43 +02:00
|
|
|
id = "mphdq-n6q7y";
|
2023-10-16 23:12:26 +02:00
|
|
|
path = "/data/music";
|
2023-01-12 23:21:42 +01:00
|
|
|
watch = false;
|
2022-07-03 10:51:43 +02:00
|
|
|
devices = [
|
|
|
|
"thinkman"
|
|
|
|
"birdman"
|
2022-12-03 12:00:55 +01:00
|
|
|
"serverle"
|
2022-07-03 10:51:43 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
"Pictures" = {
|
|
|
|
id = "cujyo-yiabu";
|
2023-10-16 23:12:26 +02:00
|
|
|
path = "/data/photos";
|
2023-01-12 23:21:42 +01:00
|
|
|
watch = false;
|
2022-07-03 10:51:43 +02:00
|
|
|
devices = [
|
|
|
|
"thinkman"
|
2022-12-03 12:00:55 +01:00
|
|
|
"serverle"
|
2022-07-03 10:51:43 +02:00
|
|
|
];
|
2022-06-26 15:34:21 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|