zion/modules/datasync.nix

65 lines
1.9 KiB
Nix
Raw Normal View History

# Syncthing and Radicale configuration
2019-11-07 14:25:27 +01:00
{ config, pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
syncthing
radicale
];
# 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"; };
roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; };
2019-11-07 14:25:27 +01:00
};
folders = {
2019-11-13 00:00:04 +01:00
"Documents" = { devices = [ "monolith" "roamer" ]; id = "wusdj-bfjkr"; };
"Notes" = { devices = [ "monolith" "roamer" ]; id = "2aqt7-vpprc"; };
2019-11-13 00:00:04 +01:00
"Music" = { devices = [ "monolith" "roamer" ]; id = "kafhz-bfmzm"; };
"Photos" = { devices = [ "monolith" "roamer" ]; id = "mjibc-ustcg"; };
2019-11-13 00:00:04 +01:00
"Security" = { devices = [ "monolith" "roamer" ]; id = "z4lpn-pmm3v"; };
"Projects" = { devices = [ "monolith" ]; id = "cjhmu-avy9v"; };
Documents.type = "receiveonly";
2019-11-22 02:23:34 +01:00
Notes.type = "receiveonly";
Music.type = "receiveonly";
Photos.type = "receiveonly";
Security.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
};
};
# 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
'';
};
}