2019-12-20 05:54:26 +01:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2020-04-10 11:36:58 +02:00
|
|
|
users.groups."syncthing".members = [ "mpd" "syncthing" "kodi" ];
|
|
|
|
|
|
|
|
custom.samba-share = {
|
2020-10-28 23:56:30 +01:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
folders = {
|
|
|
|
movies = config.test.services.syncthing.declarative.folders.movies.path;
|
|
|
|
music =
|
|
|
|
config.test.services.syncthing.declarative.folders.music-library.path;
|
|
|
|
samples = config.test.services.syncthing.declarative.folders.samples.path;
|
|
|
|
series = config.test.services.syncthing.declarative.folders.series.path;
|
|
|
|
};
|
2020-04-10 15:08:33 +02:00
|
|
|
private.test = {
|
|
|
|
folder = config.test.services.syncthing.declarative.folders.porn.path;
|
|
|
|
users = "kodi";
|
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
};
|
|
|
|
|
2019-10-29 21:02:40 +01:00
|
|
|
test.services.syncthing = {
|
2019-10-24 02:20:38 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
openDefaultPorts = true;
|
2019-10-24 02:20:38 +02:00
|
|
|
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 drive
|
|
|
|
# ------------------
|
|
|
|
|
|
|
|
# no need to be encrypted
|
|
|
|
# -----------------------
|
2020-04-10 11:36:58 +02:00
|
|
|
books = {
|
2019-10-26 13:44:27 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/books";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
movies = {
|
2019-10-26 13:44:27 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/movies";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
|
|
|
music-library = {
|
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/music-library";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
music-library-free = {
|
2019-10-26 13:44:27 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/music-library-free";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
porn = {
|
2019-10-26 13:44:27 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/porn";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
samples = {
|
2019-10-26 13:44:27 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/samples";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
series = {
|
2019-10-26 13:44:27 +02:00
|
|
|
enable = true;
|
2020-04-10 11:36:58 +02:00
|
|
|
path = "/media/syncthing/series";
|
|
|
|
rescanInterval = 8 * 3600;
|
|
|
|
};
|
|
|
|
smartphone-folder = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/smartphone-folder";
|
|
|
|
rescanInterval = 8 * 3600;
|
|
|
|
};
|
|
|
|
video-material = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/video-material";
|
2020-09-27 23:18:06 +02:00
|
|
|
rescanInterval = 8 * 3600;
|
|
|
|
};
|
|
|
|
processing = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/sketchbook";
|
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
|
2020-09-08 21:45:42 +02:00
|
|
|
system.permown."/media/syncthing" = {
|
|
|
|
owner = "syncthing";
|
|
|
|
group = "syncthing";
|
|
|
|
};
|
|
|
|
systemd.services."permown._media_syncthing" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
2020-04-10 11:36:58 +02:00
|
|
|
systemd.services."syncthing" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
|
|
|
|
2019-10-24 02:20:38 +02:00
|
|
|
}
|