zion/modules/datasync.nix

66 lines
2.0 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
];
2019-12-23 20:01:40 +01:00
# 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 = {
monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; };
roamer = { id = "DS3PJH3-J6SNMHM-XUJTDLO-DHGJL5U-J3RUMAG-4OSJWIK-VSJSDVJ-PIHZ2QP"; };
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
};
folders = {
2019-12-23 19:34:02 +01:00
"Documents" = { devices = [ "monolith" "roamer" "unit" ]; id = "wusdj-bfjkr"; };
"Notes" = { devices = [ "monolith" "roamer" "unit" ]; id = "2aqt7-vpprc"; };
"Music" = { devices = [ "monolith" "roamer" "unit" ]; id = "kafhz-bfmzm"; };
"Photos" = { devices = [ "monolith" "roamer" "unit" ]; id = "mjibc-ustcg"; };
"Security" = { devices = [ "monolith" "roamer" "unit" ]; id = "z4lpn-pmm3v"; };
"Projects" = { devices = [ "monolith" "unit" ]; id = "cjhmu-avy9v"; };
Documents.type = "receiveonly";
2019-11-22 02:23:34 +01:00
Notes.type = "receiveonly";
Music.type = "receiveonly";
2019-12-23 20:01:40 +01:00
#Photos.type = "receiveonly";
2019-11-22 02:23:34 +01:00
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
'';
};
}