132 lines
3.4 KiB
Nix
132 lines
3.4 KiB
Nix
{ config, pkgs, lib, ... }: {
|
|
|
|
custom.samba-share = {
|
|
enable = true;
|
|
folders = {
|
|
movies = config.test.services.syncthing.declarative.folders.movies.path;
|
|
series = config.test.services.syncthing.declarative.folders.series.path;
|
|
samples = config.test.services.syncthing.declarative.folders.samples.path;
|
|
music =
|
|
config.test.services.syncthing.declarative.folders.music-library.path;
|
|
};
|
|
};
|
|
|
|
test.services.syncthing = {
|
|
enable = true;
|
|
openDefaultPorts = false;
|
|
dataDir = "/home/syncthing";
|
|
configDir = "/home/syncthing";
|
|
declarative = {
|
|
cert = toString <secrets/syncthing/cert.pem>;
|
|
key = toString <secrets/syncthing/key.pem>;
|
|
overrideFolders = true;
|
|
|
|
folders = {
|
|
|
|
# on encrypted hard drive
|
|
# -----------------------
|
|
private = {
|
|
enable = true;
|
|
path = "/home/syncthing/private";
|
|
versioning = {
|
|
type = "simple";
|
|
params.keep = "10";
|
|
};
|
|
};
|
|
desktop = {
|
|
enable = true;
|
|
path = "/home/syncthing/desktop";
|
|
};
|
|
finance = {
|
|
enable = true;
|
|
path = "/home/syncthing/finance";
|
|
versioning = {
|
|
type = "simple";
|
|
params.keep = "10";
|
|
};
|
|
};
|
|
fotos = {
|
|
enable = true;
|
|
path = "/home/syncthing/fotos";
|
|
};
|
|
lost-fotos = {
|
|
enable = true;
|
|
path = "/home/syncthing/lost-fotos.ct";
|
|
};
|
|
music-projects = {
|
|
enable = true;
|
|
path = "/home/syncthing/music-projects";
|
|
};
|
|
zettlr = {
|
|
enable = true;
|
|
path = "/home/syncthing/zettlr";
|
|
};
|
|
|
|
# on media hard drive (not encrypted)
|
|
# -----------------------------------
|
|
video-material = {
|
|
enable = true;
|
|
path = "/home/syncthing/video-material";
|
|
};
|
|
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;
|
|
};
|
|
movies = {
|
|
enable = true;
|
|
path = "/media/syncthing/movies";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
music-library = {
|
|
enable = true;
|
|
path = "/media/syncthing/music-library";
|
|
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;
|
|
};
|
|
workhorse-sterni = {
|
|
enable = true;
|
|
path = "/media/syncthing/sync-to-sterni";
|
|
rescanInterval = 8 * 3600;
|
|
};
|
|
|
|
};
|
|
};
|
|
};
|
|
|
|
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" ];
|
|
};
|
|
|
|
backup.all.restic.dirs = [ "/home/syncthing/finance" ];
|
|
|
|
}
|