68 lines
1.6 KiB
Nix
68 lines
1.6 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
{
|
|
|
|
services.syncthing = {
|
|
enable = true;
|
|
openDefaultPorts = true;
|
|
declarative = {
|
|
cert = toString <secrets/syncthing/cert.pem>;
|
|
key = toString <secrets/syncthing/key.pem>;
|
|
overrideFolders = true;
|
|
folders = {
|
|
# on encrypted device
|
|
# -------------------
|
|
desktop = {
|
|
enable = true;
|
|
path = "/var/lib/syncthing/desktop";
|
|
};
|
|
finance = {
|
|
enable = true;
|
|
path = "/var/lib/syncthing/finance";
|
|
};
|
|
lost-fotos = {
|
|
enable = true;
|
|
path = "/var/lib/syncthing/lost-fotos.ct";
|
|
};
|
|
|
|
# on media hard drive (not encrypted)
|
|
# -----------------------------------
|
|
movies = {
|
|
enable = true;
|
|
path = "/media/movies";
|
|
};
|
|
music-library = {
|
|
enable = true;
|
|
path = "/media/music-library";
|
|
};
|
|
podcasts = {
|
|
enable = true;
|
|
path = "/media/podcasts";
|
|
};
|
|
series = {
|
|
enable = true;
|
|
path = "/media/series";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
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" ];
|
|
|
|
backup.all.restic.dirs = ["/var/lib/syncthing/finance"];
|
|
|
|
}
|
|
|