nixos-config/configs/pepe/syncthing.nix

100 lines
2.6 KiB
Nix
Raw Normal View History

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 = {
enable = true;
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
};
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";
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-06-11 16:53:29 +02:00
# todo not working properly
#systemd.services."permown._media_syncthing" = {
# bindsTo = [ "media.mount" ];
# after = [ "media.mount" ];
#};
#system.permown."/media/syncthing" = {
# owner = "syncthing";
# group = "syncthing";
# umask = "0003";
#};
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
}