2019-11-08 01:05:42 +01:00
|
|
|
# syncthingthing and Radicale configuration
|
2019-11-07 14:25:27 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
syncthing
|
|
|
|
syncthing-relay
|
|
|
|
syncthing-discovery
|
|
|
|
radicale
|
|
|
|
];
|
|
|
|
|
2019-11-08 01:05:42 +01:00
|
|
|
# Enable syncthingthing
|
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 = {
|
|
|
|
monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; };
|
2019-11-08 01:05:42 +01:00
|
|
|
roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; };
|
2019-11-07 14:25:27 +01:00
|
|
|
};
|
|
|
|
#cert = "";
|
|
|
|
#key = "";
|
2019-11-08 01:05:42 +01:00
|
|
|
folders = {
|
|
|
|
"Documents" = { devices = [ "monolith" ]; id = "wusdj-bfjkr"; };
|
|
|
|
"Notes" = { devices = [ "monolith" "roamer" ]; id = "2aqt7-vpprc"; };
|
|
|
|
"Music" = { devices = [ "monolith" ]; id = "kafhz-bfmzm"; };
|
|
|
|
"Photos" = { devices = [ "monolith" "roamer" ]; id = "mjibc-ustcg"; };
|
|
|
|
"Security" = { devices = [ "monolith" ]; id = "z4lpn-pmm3v"; };
|
|
|
|
"Projects" = { devices = [ "monolith" ]; id = "cjhmu-avy9v"; };
|
|
|
|
|
|
|
|
Documents.type = "receiveonly";
|
|
|
|
Projects.type = "receiveonly";
|
|
|
|
|
|
|
|
Documents.path = "/vault/syncthing/Documents";
|
|
|
|
Notes.path = "/vault/syncthing/Notes";
|
|
|
|
Music.path = "/vault/syncthing/Music";
|
|
|
|
Photos.path = "/vault/syncthing/Photos";
|
|
|
|
Security.path = "/vault/syncthing/Security";
|
|
|
|
Projects.path = "/vault/syncthing/Projects";
|
|
|
|
};
|
2019-11-07 14:25:27 +01:00
|
|
|
};
|
2019-11-08 14:14:32 +01:00
|
|
|
relay = {
|
|
|
|
enable = true;
|
|
|
|
pools = [ "" ];
|
|
|
|
listenAddress = "0.0.0.0";
|
|
|
|
};
|
2019-11-07 14:25:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# Enable Radicale
|
|
|
|
services.radicale = {
|
|
|
|
enable = true;
|
|
|
|
config = ''
|
2019-11-08 14:14:32 +01:00
|
|
|
[server]
|
|
|
|
hosts = 0.0.0.0:5232
|
|
|
|
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
|
|
|
|
htpasswd_filename = /var/lib/radicale/radicale.users
|
|
|
|
htpasswd_encryption = plain
|
|
|
|
delay = 1
|
2019-11-07 14:25:27 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|