diff --git a/modules/services/nas/syncthing.nix b/modules/services/nas/syncthing.nix new file mode 100644 index 0000000..db830e2 --- /dev/null +++ b/modules/services/nas/syncthing.nix @@ -0,0 +1,42 @@ +# +# System notifications +# + +{ config, lib, pkgs, ... }: + +{ + services.syncthing = { + enable = true; + group = "users"; + user = "kabbone"; + dataDir = "/home/${config.services.syncthing.user}/Sync"; + configDir = "/home/${config.services.syncthing.user}/.config/syncthing"; + overrideDevices = true; # overrides any devices added or deleted through the WebUI + overrideFolders = true; # overrides any folders added or deleted through the WebUI + openDefaultPorts = true; + settings = { + devices = { + "hades" = { id = "DEVICE-ID-GOES-HERE"; }; + "lifebook" = { id = "DEVICE-ID-GOES-HERE"; }; + }; + folders = { + "Sync" = { # Name of folder in Syncthing, also the folder ID + path = "/home/${config.services.syncthing.user}/Sync"; # Which folder to add to Syncthing + devices = [ "hades" "lifebook" ]; # Which devices to share the folder with + ignorePerms = false; # By default, Syncthing doesn't sync file permissions. This line enables it for this folder. + }; + }; + }; + }; + + services.nginx = { + virtualHosts = { + "syncthing.home.opel-online.de" = { + useACMEHost = "home.opel-online.de"; + forceSSL = true; + locations."/".proxyPass = "${toString config.services.syncthing.guiAddress}"; + }; + }; + }; + +}