94 lines
2.4 KiB
Nix
94 lines
2.4 KiB
Nix
{ config, pkgs, lib, ... }: {
|
|
|
|
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;
|
|
};
|
|
};
|
|
|
|
test.services.syncthing = {
|
|
enable = true;
|
|
openDefaultPorts = true;
|
|
declarative = {
|
|
cert = toString <secrets/syncthing/cert.pem>;
|
|
key = toString <secrets/syncthing/key.pem>;
|
|
|
|
overrideFolders = true;
|
|
folders = {
|
|
|
|
# on encrypted drive
|
|
# ------------------
|
|
|
|
# no need to be encrypted
|
|
# -----------------------
|
|
books = {
|
|
enable = true;
|
|
path = "/media/syncthing/books";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
movies = {
|
|
enable = true;
|
|
path = "/media/syncthing/movies";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
music-library = {
|
|
enable = true;
|
|
path = "/media/syncthing/music-library";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
music-library-free = {
|
|
enable = true;
|
|
path = "/media/syncthing/music-library-free";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
porn = {
|
|
enable = true;
|
|
path = "/media/syncthing/porn";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
samples = {
|
|
enable = true;
|
|
path = "/media/syncthing/samples";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
series = {
|
|
enable = true;
|
|
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";
|
|
};
|
|
|
|
};
|
|
};
|
|
};
|
|
|
|
systemd.services."permown._media_syncthing" = {
|
|
bindsTo = [ "media.mount" ];
|
|
after = [ "media.mount" ];
|
|
};
|
|
system.permown."/media/syncthing" = {
|
|
owner = "syncthing";
|
|
group = "syncthing";
|
|
umask = "0007";
|
|
};
|
|
systemd.services."syncthing" = {
|
|
bindsTo = [ "media.mount" ];
|
|
after = [ "media.mount" ];
|
|
};
|
|
|
|
}
|