39 lines
873 B
Nix
39 lines
873 B
Nix
|
{ config, pkgs, lib, ... }:
|
||
|
{
|
||
|
|
||
|
test.services.syncthing = {
|
||
|
enable = true;
|
||
|
openDefaultPorts = true;
|
||
|
declarative = {
|
||
|
cert = toString <secrets/syncthing/cert.pem>;
|
||
|
key = toString <secrets/syncthing/key.pem>;
|
||
|
overrideFolders = true;
|
||
|
folders = {
|
||
|
movies.path = "/media/movies";
|
||
|
music-library.path = "/media/music-library";
|
||
|
podcasts.path = "/media/podcasts";
|
||
|
series.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" ];
|
||
|
|
||
|
|
||
|
|
||
|
}
|