nixos-config/configs/porani/syncthing.nix

65 lines
1.7 KiB
Nix
Raw Normal View History

2019-12-20 05:54:26 +01:00
{ config, pkgs, lib, ... }: {
networking.firewall.interfaces."tinc.insecure".allowedTCPPorts = [ 8384 ];
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-10-24 02:20:38 +02:00
test.services.syncthing = {
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";
rescanInterval = 8 * 3600;
2019-10-26 13:44:27 +02:00
};
music-library = {
enable = true;
path = "/media/music-library";
rescanInterval = 8 * 3600;
2019-10-26 13:44:27 +02:00
};
series = {
enable = true;
path = "/media/series";
rescanInterval = 8 * 3600;
2019-10-26 13:44:27 +02:00
};
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" ];
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