nixos-config/configs/porani/syncthing.nix

89 lines
2.2 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ 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;
music = config.test.services.syncthing.declarative.folders.music-library.path;
};
};
2019-10-24 02:20:38 +02:00
test.services.syncthing = {
2019-10-24 02:20:38 +02:00
enable = true;
openDefaultPorts = true;
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 device
# -------------------
2019-10-26 13:44:27 +02:00
desktop = {
enable = true;
path = "/var/lib/syncthing/desktop";
};
finance = {
enable = true;
path = "/var/lib/syncthing/finance";
versioning = {
type = "simple";
params.keep = "10";
};
2019-10-26 13:44:27 +02:00
};
fotos = {
enable = true;
path = "/var/lib/syncthing/fotos";
};
2019-10-26 13:44:27 +02:00
lost-fotos = {
enable = true;
path = "/var/lib/syncthing/lost-fotos.ct";
};
2019-10-25 03:03:25 +02:00
# on media hard drive (not encrypted)
# -----------------------------------
2019-10-26 13:44:27 +02:00
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";
};
2019-12-17 10:42:59 +01:00
smartphone-music= {
enable = true;
path = "/media/smartphone-music";
};
2019-10-24 02:20:38 +02:00
};
};
};
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" ];
2019-10-25 09:54:38 +02:00
backup.all.restic.dirs = ["/var/lib/syncthing/finance"];
2019-10-24 02:20:38 +02:00
}
2019-10-25 09:54:38 +02:00