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 = {
|
2020-11-21 18:56:11 +01:00
|
|
|
movies = config.services.syncthing.declarative.folders.movies.path;
|
|
|
|
music = config.services.syncthing.declarative.folders.music-library.path;
|
|
|
|
samples = config.services.syncthing.declarative.folders.samples.path;
|
|
|
|
series = config.services.syncthing.declarative.folders.series.path;
|
2021-02-18 04:22:30 +01:00
|
|
|
books = config.services.syncthing.declarative.folders.books.path;
|
2020-04-10 11:36:58 +02:00
|
|
|
};
|
2021-03-06 05:50:10 +01:00
|
|
|
#private.test = {
|
|
|
|
# folder = ;
|
|
|
|
# users = "kodi";
|
|
|
|
#};
|
2020-04-10 11:36:58 +02:00
|
|
|
};
|
|
|
|
|
2020-11-21 18:56:11 +01:00
|
|
|
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
|
|
|
|
# ------------------
|
2021-02-19 11:42:37 +01:00
|
|
|
private = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/private";
|
|
|
|
};
|
|
|
|
desktop = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/desktop";
|
|
|
|
};
|
|
|
|
finance = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/finance";
|
|
|
|
};
|
|
|
|
lost-fotos = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/lost-fotos.ct";
|
|
|
|
};
|
|
|
|
fotos = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/fotos";
|
|
|
|
};
|
|
|
|
zettlr = {
|
|
|
|
enable = true;
|
|
|
|
path = "/home/syncthing/zettlr";
|
|
|
|
};
|
2019-10-25 03:03:25 +02:00
|
|
|
|
|
|
|
# no need to be encrypted
|
|
|
|
# -----------------------
|
2021-03-21 18:23:32 +01:00
|
|
|
borg-mirror = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/borg";
|
|
|
|
rescanInterval = 36 * 3600;
|
|
|
|
type = "receiveonly";
|
|
|
|
};
|
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
|
|
|
};
|
2021-02-19 11:42:37 +01:00
|
|
|
music-projects = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/syncthing/music-projects";
|
|
|
|
};
|
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
|
|
|
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
|
|
|
|
2021-02-19 11:42:37 +01:00
|
|
|
system.permown."/home/syncthing" = {
|
|
|
|
owner = "syncthing";
|
|
|
|
group = "syncthing";
|
|
|
|
};
|
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
|
|
|
}
|