nixos-config/configs/workhorse/syncthing.nix

97 lines
2.2 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
{
test.services.syncthing = {
2019-10-24 02:20:38 +02:00
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 = {
# todo add podcast here
# on encrypted hard drive
# -----------------------
2019-10-26 13:44:27 +02:00
desktop = {
enable = true;
path = "/home/syncthing/desktop";
};
finance = {
enable = true;
path = "/home/syncthing/finance";
versioning = {
type = "simple";
params.keep = "10";
};
2019-10-26 13:44:27 +02:00
};
fotos = {
enable = true;
path = "/home/syncthing/fotos";
};
2019-10-26 13:44:27 +02:00
lost-fotos = {
enable = true;
path = "/home/syncthing/lost-fotos.ct";
};
music-projects = {
enable = true;
path = "/home/syncthing/music-projects";
};
video-material = {
enable = true;
path = "/home/syncthing/video-material";
};
2019-10-24 02:20:38 +02:00
# on media hard drive (not encrypted)
# -----------------------------------
2019-10-26 13:44:27 +02:00
music-library-free = {
enable = true;
path = "/media/syncthing/music-library-free";
};
samples = {
enable = true;
path = "/media/syncthing/samples";
};
movies = {
enable = true;
path = "/media/syncthing/movies";
};
music-library = {
enable = true;
path = "/media/syncthing/music-library";
};
podcasts = {
enable = true;
path = "/media/syncthing/podcasts";
};
series = {
enable = true;
path = "/media/syncthing/series";
};
2019-10-24 02:20:38 +02:00
};
};
};
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" ];
};
2019-10-25 09:54:38 +02:00
backup.all.restic.dirs = ["/home/syncthing/finance"];
2019-10-24 02:20:38 +02:00
}