2019-12-20 05:54:26 +01:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-18 04:15:58 +01:00
|
|
|
custom.samba-share = {
|
|
|
|
enable = true;
|
|
|
|
folders = {
|
2020-11-21 18:56:11 +01:00
|
|
|
movies = config.services.syncthing.declarative.folders.movies.path;
|
|
|
|
series = config.services.syncthing.declarative.folders.series.path;
|
|
|
|
samples = config.services.syncthing.declarative.folders.samples.path;
|
|
|
|
music = config.services.syncthing.declarative.folders.music-library.path;
|
2021-02-18 04:22:30 +01:00
|
|
|
books = config.services.syncthing.declarative.folders.books.path;
|
2019-12-18 04:15:58 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-10-31 17:49:44 +01:00
|
|
|
|
|
|
|
sops.secrets.syncthing_cert = { };
|
|
|
|
sops.secrets.syncthing_key = { };
|
|
|
|
|
2020-11-21 18:56:11 +01:00
|
|
|
services.syncthing = {
|
2019-12-20 05:54:26 +01:00
|
|
|
enable = true;
|
|
|
|
openDefaultPorts = false;
|
|
|
|
dataDir = "/home/syncthing";
|
|
|
|
configDir = "/home/syncthing";
|
|
|
|
declarative = {
|
2021-10-31 17:49:44 +01:00
|
|
|
cert = toString config.sops.secrets.syncthing_cert.path;
|
|
|
|
key = toString config.sops.secrets.syncthing_key.path;
|
2019-12-20 05:54:26 +01:00
|
|
|
overrideFolders = true;
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
folders = {
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
# on encrypted hard drive
|
|
|
|
# -----------------------
|
|
|
|
private = {
|
2019-11-22 11:46:39 +01:00
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/private";
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
|
|
|
desktop = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/desktop";
|
|
|
|
};
|
|
|
|
finance = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/finance";
|
|
|
|
};
|
|
|
|
fotos = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/fotos";
|
|
|
|
};
|
|
|
|
lost-fotos = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/lost-fotos.ct";
|
|
|
|
};
|
2020-03-31 11:33:31 +02:00
|
|
|
zettlr = {
|
2019-12-20 05:54:26 +01:00
|
|
|
enable = true;
|
2020-03-31 11:33:31 +02:00
|
|
|
path = "/home/syncthing/zettlr";
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
# on media hard drive (not encrypted)
|
|
|
|
# -----------------------------------
|
2021-03-21 18:23:32 +01:00
|
|
|
borg-mirror = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/borg";
|
|
|
|
rescanInterval = 36 * 3600;
|
|
|
|
type = "sendonly";
|
|
|
|
};
|
2020-03-31 11:33:31 +02:00
|
|
|
video-material = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/video-material";
|
|
|
|
};
|
2019-12-20 05:54:26 +01:00
|
|
|
music-library-free = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/music-library-free";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
2021-02-18 04:22:30 +01:00
|
|
|
books = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/books";
|
|
|
|
rescanInterval = 8 * 3600;
|
|
|
|
};
|
2019-12-20 05:54:26 +01:00
|
|
|
samples = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/samples";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
|
|
|
movies = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/movies";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
2021-02-19 11:42:37 +01:00
|
|
|
# todo : no need to place it on encrypted drive
|
|
|
|
music-projects = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/music-projects";
|
|
|
|
};
|
2019-12-20 05:54:26 +01:00
|
|
|
music-library = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/music-library";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
|
|
|
series = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/series";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
2020-03-14 19:29:50 +01:00
|
|
|
smartphone-folder = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/smartphone-folder";
|
|
|
|
rescanInterval = 8 * 3600;
|
2020-03-19 17:26:00 +01:00
|
|
|
};
|
2020-09-27 23:18:06 +02:00
|
|
|
processing = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/sketchbook";
|
|
|
|
rescanInterval = 8 * 3600;
|
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2021-02-19 11:42:37 +01:00
|
|
|
system.permown."/home/syncthing" = {
|
|
|
|
owner = "syncthing";
|
|
|
|
group = "syncthing";
|
2021-03-23 07:37:21 +01:00
|
|
|
umask = "0022";
|
2021-02-19 11:42:37 +01:00
|
|
|
};
|
2020-09-08 21:45:42 +02:00
|
|
|
system.permown."/media/syncthing" = {
|
|
|
|
owner = "syncthing";
|
|
|
|
group = "syncthing";
|
2021-03-23 07:37:21 +01:00
|
|
|
umask = "0022";
|
2020-09-08 21:45:42 +02:00
|
|
|
};
|
|
|
|
systemd.services."permown._media_syncthing" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
systemd.services."syncthing" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
|
|
|
|
2020-09-04 00:49:35 +02:00
|
|
|
backup.dirs = [ "/home/syncthing/finance" ];
|
2019-10-25 09:54:38 +02:00
|
|
|
|
2019-10-24 02:20:38 +02:00
|
|
|
}
|