nixos/modules/syncthing.nix

41 lines
1.6 KiB
Nix
Raw Normal View History

2024-03-05 22:57:41 +01:00
{...}: {
2023-08-25 00:57:42 +02:00
# Syncthing is a continuous file synchronization program. It synchronizes
# files between two or more computers in real time. It's basically a
# self-hosted Dropbox for Linux users, but without FTP, curlftpfs, and SVN.
2023-08-12 03:20:56 +02:00
# https://nixos.wiki/wiki/Syncthing
services.syncthing = {
enable = true;
user = "caspervk";
2023-08-12 16:17:04 +02:00
group = "users";
2023-08-25 00:57:42 +02:00
# The directory where synchronised directories will exist
2023-08-12 03:20:56 +02:00
dataDir = "/home/caspervk";
2023-12-01 21:52:30 +01:00
settings = {
# Devices ignore their own IDs, allowing for a single configuration.
# TODO: Syncthing generates a private key and ID the first time it is
# started. On first install, add the devices' ID here and apply to the
# other ones. When we get a proper secret management scheme, such as
# agenix, the private keys should be managed declaratively as well.
devices = {
2024-03-12 22:23:41 +01:00
"android" = {id = "IBP6YKY-KGWYPCH-J3CHAQ5-GKCIQ3U-X2L7S7V-BH635EE-ZEDQHN2-ZB4CBAP";};
2023-12-01 21:52:30 +01:00
"lambda" = {
id = "WES3JH4-S34HTC5-42YZHUJ-MX3Z6PA-PFO72KA-YIJMDOB-GQWZXZ3-I7BBTAS";
2024-03-05 22:57:41 +01:00
addresses = ["tcp://lambda.caspervk.net"];
2023-12-01 21:52:30 +01:00
};
2024-03-05 22:57:41 +01:00
"omega" = {id = "EZIQ7SI-Y6BBLUY-QI4EEYU-UNIXPSG-R6X5E77-AA2UC7S-VRV2LKQ-RNBOGQT";};
"zeta" = {id = "GQRNHAQ-MMRQYMD-P4RCA6I-5DJ3HXO-J2N2GVP-UGI55YR-HD3EYSO-ERU5QQV";};
2023-08-12 03:20:56 +02:00
};
2023-12-01 21:52:30 +01:00
folders = {
"keepass" = {
path = "~/keepass";
2024-03-12 22:23:41 +01:00
devices = ["android" "lambda" "omega" "zeta"];
2023-12-01 21:52:30 +01:00
};
"sync" = {
path = "~/sync";
2024-03-05 22:57:41 +01:00
devices = ["lambda" "omega" "zeta"];
2023-12-01 21:52:30 +01:00
};
2023-08-12 03:20:56 +02:00
};
};
};
}