2020-06-09 21:53:20 +02:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2020-10-28 00:38:24 +01:00
|
|
|
|
|
|
|
# Syncthing configuration
|
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-06-09 21:53:20 +02:00
|
|
|
panacea = {
|
|
|
|
id =
|
|
|
|
"UNZIABR-GEQ4AWT-XKFADLW-HW3SQ3Y-BEYZ56A-W530DLS-DXGQWKK-2QQ4RQ6";
|
|
|
|
};
|
2020-09-24 16:13:02 +02:00
|
|
|
prosorinos = {
|
|
|
|
id =
|
|
|
|
"3VO3M5I-FXJXPFZ-HSSBQIJ-4ZK4ALK-O3MI2CL-TS7BNBC-Z5OLGE2-MO7K3QK ";
|
|
|
|
};
|
2019-11-07 14:25:27 +01:00
|
|
|
};
|
2019-11-08 01:05:42 +01:00
|
|
|
folders = {
|
2020-02-25 14:03:24 +01:00
|
|
|
Documents = {
|
|
|
|
id = "wusdj-bfjkr";
|
|
|
|
type = "receiveonly";
|
|
|
|
path = "/vault/syncthing/Documents";
|
2020-09-24 21:56:25 +02:00
|
|
|
devices = [ "panacea" "prosorinos" ];
|
2020-02-25 14:03:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Notes = {
|
|
|
|
id = "kafhz-bfmzm";
|
|
|
|
type = "receiveonly";
|
|
|
|
path = "/vault/syncthing/Notes";
|
2020-09-24 21:56:25 +02:00
|
|
|
devices = [ "panacea" "prosorinos" ];
|
2020-02-25 14:03:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Music = {
|
|
|
|
id = "2aqt7-vpprc";
|
|
|
|
type = "receiveonly";
|
|
|
|
path = "/vault/syncthing/Music";
|
2020-09-24 21:56:25 +02:00
|
|
|
devices = [ "panacea" "prosorinos" ];
|
2020-02-25 14:03:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Photos = {
|
|
|
|
id = "mjibc-ustcg";
|
|
|
|
type = "receiveonly";
|
|
|
|
path = "/vault/syncthing/Photos";
|
2020-09-24 21:56:25 +02:00
|
|
|
devices = [ "panacea" "prosorinos" ];
|
2020-02-25 14:03:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
Projects = {
|
|
|
|
id = "cjhmu-avy9v";
|
|
|
|
type = "receiveonly";
|
|
|
|
path = "/vault/syncthing/Projects";
|
2020-06-09 21:53:20 +02:00
|
|
|
devices = [ "panacea" ];
|
2020-02-25 14:03:24 +01:00
|
|
|
};
|
2019-11-08 01:05:42 +01:00
|
|
|
};
|
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
|
2020-09-06 14:04:17 +02: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
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2020-06-20 02:00:59 +02:00
|
|
|
# ZFS automatic snapshotting
|
|
|
|
services.znapzend = {
|
|
|
|
enable = true;
|
|
|
|
autoCreation = true;
|
|
|
|
features = {
|
|
|
|
compressed = true;
|
|
|
|
recvu = true;
|
|
|
|
};
|
|
|
|
zetup = {
|
|
|
|
"vault/backups" = {
|
|
|
|
plan = "1day=>1hour,1month=>1day,1year=>1month";
|
|
|
|
recursive = true;
|
|
|
|
mbuffer.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"vault/syncthing" = {
|
|
|
|
plan = "1hour=>15min,1day=>15min,1month=>1day,1year=>1month";
|
|
|
|
recursive = true;
|
|
|
|
mbuffer.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"vault/git" = {
|
|
|
|
plan = "1hour=>15min,1day=>1hour,1month=>1day,1year=>1month";
|
|
|
|
recursive = true;
|
|
|
|
mbuffer.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-11-07 14:25:27 +01:00
|
|
|
}
|