2019-12-20 05:54:26 +01:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2020-02-03 07:08:43 +01:00
|
|
|
|
|
|
|
networking.firewall.interfaces."tinc.insecure".allowedTCPPorts = [ 8384 ];
|
|
|
|
|
2019-12-18 04:15:58 +01:00
|
|
|
custom.samba-share = {
|
|
|
|
enable = true;
|
|
|
|
folders = {
|
|
|
|
movies = config.test.services.syncthing.declarative.folders.movies.path;
|
|
|
|
series = config.test.services.syncthing.declarative.folders.series.path;
|
2019-12-20 05:54:26 +01:00
|
|
|
music =
|
|
|
|
config.test.services.syncthing.declarative.folders.music-library.path;
|
2019-12-18 04:15:58 +01:00
|
|
|
};
|
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-10-29 21:02:40 +01:00
|
|
|
test.services.syncthing = {
|
2020-02-03 07:08:43 +01:00
|
|
|
guiAddress = lib.mkForce "${config.networking.hostName}.insecure:8384";
|
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 media hard drive (not encrypted)
|
|
|
|
# -----------------------------------
|
2019-10-26 13:44:27 +02:00
|
|
|
movies = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/movies";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
|
|
|
music-library = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/music-library";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
|
|
|
series = {
|
|
|
|
enable = true;
|
|
|
|
path = "/media/series";
|
2020-01-26 02:33:50 +01:00
|
|
|
rescanInterval = 8 * 3600;
|
2019-10-26 13:44:27 +02:00
|
|
|
};
|
2019-10-24 02:20:38 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
system.permown."/media" = {
|
|
|
|
owner = "syncthing";
|
|
|
|
group = "syncthing";
|
2020-09-08 21:45:42 +02:00
|
|
|
};
|
|
|
|
systemd.services."permown._media" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
2019-10-24 02:20:38 +02:00
|
|
|
};
|
|
|
|
systemd.services."syncthing" = {
|
|
|
|
bindsTo = [ "media.mount" ];
|
|
|
|
after = [ "media.mount" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups."syncthing".members = [ "mpd" "syncthing" "kodi" "palo" ];
|
|
|
|
|
2020-09-04 00:49:35 +02:00
|
|
|
backup.dirs = [ "/var/lib/syncthing/finance" ];
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
}
|
2019-10-25 09:54:38 +02:00
|
|
|
|