106 lines
2.6 KiB
Nix
106 lines
2.6 KiB
Nix
{ config, pkgs, lib, ... }: {
|
|
|
|
# Syncthing configuration
|
|
services.syncthing = {
|
|
enable = true;
|
|
openDefaultPorts = true;
|
|
guiAddress = "0.0.0.0:8384";
|
|
dataDir = "/vault/syncthing";
|
|
key = config.age.secrets.syncthing.path;
|
|
devices = {
|
|
panacea.id =
|
|
"NF4SYEJ-RSGPDEF-CDEYC3A-JWZMKNC-KG4FVQP-CZ5HRFY-XM22BZD-N7B6VAH";
|
|
caravanserai.id =
|
|
"MIRF73R-S7AV47R-VLWZUK2-TFCVQPV-FRYCPND-Y4VR3W2-ZAIQXZD-JAEQCAD";
|
|
};
|
|
folders = {
|
|
Documents = {
|
|
id = "wusdj-bfjkr";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Documents";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
|
|
Notes = {
|
|
id = "kafhz-bfmzm";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Notes";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
|
|
Music = {
|
|
id = "2aqt7-vpprc";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Music";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
|
|
Photos = {
|
|
id = "mjibc-ustcg";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Photos";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
|
|
Projects = {
|
|
id = "cjhmu-avy9v";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Projects";
|
|
devices = [ "panacea" ];
|
|
};
|
|
|
|
Phone = {
|
|
id = "m2007j20cg_vc7r-photos";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Photos/Phone";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
|
|
Files = {
|
|
id = "tsk52-u6rbk";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Files";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
|
|
Phone-screenshots = {
|
|
id = "pp70r-pbr70";
|
|
type = "receiveonly";
|
|
path = "/vault/syncthing/Photos/Phone-screenshots";
|
|
devices = [ "panacea" "caravanserai" ];
|
|
};
|
|
};
|
|
};
|
|
|
|
# Enable Radicale
|
|
services.radicale = {
|
|
enable = true;
|
|
settings = {
|
|
server.hosts = [ "127.0.0.1:5232" ];
|
|
auth = {
|
|
type = "htpasswd";
|
|
htpasswd_filename = "/vault/radicale/users";
|
|
htpasswd_encryption = "md5";
|
|
delay = 1;
|
|
};
|
|
storage.filesystem_folder = "/vault/radicale/collections";
|
|
};
|
|
};
|
|
|
|
# ZFS automatic snapshots
|
|
services.zfs.autoSnapshot = {
|
|
enable = true;
|
|
frequent = 4;
|
|
hourly = 24;
|
|
daily = 7;
|
|
weekly = 4;
|
|
monthly = 12;
|
|
};
|
|
|
|
# Start services after ZFS mount
|
|
systemd.services.syncthing.unitConfig.RequiresMountsFor =
|
|
[ /vault/syncthing ];
|
|
systemd.services.radicale.unitConfig.RequiresMountsFor = [ /vault/radicale ];
|
|
|
|
}
|