2019-10-24 02:20:38 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
|
2019-10-29 21:02:40 +01:00
|
|
|
test.services.syncthing = {
|
2019-10-24 02:20:38 +02:00
|
|
|
enable = true;
|
|
|
|
openDefaultPorts = true;
|
|
|
|
declarative = {
|
|
|
|
cert = toString <secrets/syncthing/cert.pem>;
|
|
|
|
key = toString <secrets/syncthing/key.pem>;
|
|
|
|
overrideFolders = true;
|
|
|
|
folders = {
|
2019-10-25 03:03:25 +02:00
|
|
|
# on encrypted device
|
|
|
|
# -------------------
|
2019-10-26 13:44:27 +02:00
|
|
|
desktop = {
|
|
|
|
enable = true;
|
|
|
|
path = "/var/lib/syncthing/desktop";
|
|
|
|
};
|
|
|
|
finance = {
|
|
|
|
enable = true;
|
|
|
|
path = "/var/lib/syncthing/finance";
|
2019-10-29 21:02:40 +01:00
|
|
|
versioning = {
|
2019-11-07 13:42:23 +01:00
|
|
|
type = "simple";
|
|
|
|
params.keep = "10";
|
2019-10-29 21:02:40 +01:00
|
|
|
};
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2019-11-07 13:42:23 +01:00
|
|
|
fotos = {
|
|
|
|
enable = true;
|
|
|
|
path = "/var/lib/syncthing/fotos";
|
|
|
|
};
|
2019-10-26 13:44:27 +02:00
|
|
|
lost-fotos = {
|
|
|
|
enable = true;
|
|
|
|
path = "/var/lib/syncthing/lost-fotos.ct";
|
|
|
|
};
|
2019-10-25 03:03:25 +02:00
|
|
|
|
|
|
|
# on media hard drive (not encrypted)
|
|
|
|
# -----------------------------------
|
2019-10-26 13:44:27 +02:00
|
|
|
movies = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/movies";
|
|
|
|
};
|
|
|
|
music-library = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/music-library";
|
|
|
|
};
|
|
|
|
podcasts = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/podcasts";
|
|
|
|
};
|
|
|
|
series = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/series";
|
|
|
|
};
|
2019-12-17 10:42:59 +01:00
|
|
|
smartphone-music= {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/smartphone-music";
|
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services."permown._media" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
|
|
|
system.permown."/media" = {
|
|
|
|
owner = "syncthing";
|
|
|
|
group = "syncthing";
|
|
|
|
umask = "0007";
|
|
|
|
};
|
|
|
|
systemd.services."syncthing" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups."syncthing".members = [ "mpd" "syncthing" "kodi" "palo" ];
|
|
|
|
|
2019-10-25 09:54:38 +02:00
|
|
|
backup.all.restic.dirs = ["/var/lib/syncthing/finance"];
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
}
|
2019-10-25 09:54:38 +02:00
|
|
|
|