2019-11-08 14:36:12 +01:00
|
|
|
# Syncthing and Radicale configuration
|
2019-11-07 14:25:27 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
2020-01-28 21:54:39 +01:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
syncthing
|
|
|
|
radicale
|
|
|
|
];
|
|
|
|
|
|
|
|
# Enable syncthing
|
2019-11-07 14:25:27 +01:00
|
|
|
services.syncthing = {
|
|
|
|
enable = true;
|
|
|
|
openDefaultPorts = true;
|
|
|
|
guiAddress = "0.0.0.0:8384";
|
|
|
|
dataDir = "/vault/syncthing";
|
|
|
|
declarative = {
|
|
|
|
devices = {
|
2020-01-30 13:23:23 +01:00
|
|
|
monolith = { id = "64P2YDH-S5V7PKM-XXBOSXC-WEXUSC7-B553ELI-6IJ3CPJ-ZFB3YA5-MTKAFAH"; };
|
|
|
|
roamer = { id = "XE6YPFU-TB7ARWF-7NDSJ35-2PBNNDS-VTXGGCH-KC2UBLE-UHWAXH3-MWD26A5"; };
|
2019-12-23 19:34:02 +01:00
|
|
|
unit = { id = "VYHHL4A-KJ6WUYQ-4SNWNA3-YRCFTHE-52ZTRLP-4LV6ZDV-4VAJLHC-RJXYYQY"; };
|
2019-11-07 14:25:27 +01:00
|
|
|
};
|
2019-11-08 01:05:42 +01:00
|
|
|
folders = {
|
2019-12-23 19:34:02 +01:00
|
|
|
"Documents" = { devices = [ "monolith" "roamer" "unit" ]; id = "wusdj-bfjkr"; };
|
2019-12-23 21:23:13 +01:00
|
|
|
"Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; };
|
|
|
|
"Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; };
|
2019-12-23 19:34:02 +01:00
|
|
|
"Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; };
|
|
|
|
"Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; };
|
2019-11-08 01:05:42 +01:00
|
|
|
|
2019-11-21 16:57:17 +01:00
|
|
|
Documents.type = "receiveonly";
|
2019-11-22 02:23:34 +01:00
|
|
|
Notes.type = "receiveonly";
|
|
|
|
Music.type = "receiveonly";
|
2019-12-23 21:23:13 +01:00
|
|
|
Photos.type = "receiveonly";
|
2019-11-08 01:05:42 +01:00
|
|
|
Projects.type = "receiveonly";
|
|
|
|
|
|
|
|
Documents.path = "/vault/syncthing/Documents";
|
|
|
|
Notes.path = "/vault/syncthing/Notes";
|
|
|
|
Music.path = "/vault/syncthing/Music";
|
|
|
|
Photos.path = "/vault/syncthing/Photos";
|
|
|
|
Projects.path = "/vault/syncthing/Projects";
|
|
|
|
};
|
2019-11-07 14:25:27 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enable Radicale
|
|
|
|
services.radicale = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
2019-11-08 14:14:32 +01:00
|
|
|
[server]
|
2019-11-11 14:30:45 +01:00
|
|
|
hosts = 127.0.0.1:5232
|
2019-11-08 14:14:32 +01:00
|
|
|
max_connections = 20
|
|
|
|
max_content_length = 100000000
|
|
|
|
timeout = 30
|
2019-11-07 14:25:27 +01:00
|
|
|
|
2019-11-08 14:14:32 +01:00
|
|
|
[auth]
|
|
|
|
type = htpasswd
|
2019-11-14 01:31:27 +01:00
|
|
|
htpasswd_filename = /var/lib/radicale/users
|
2019-11-08 14:14:32 +01:00
|
|
|
htpasswd_encryption = plain
|
|
|
|
delay = 1
|
2019-11-07 14:25:27 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|