nixos-config/configurations/host/waffentrager/services/syncthing.nix

28 lines
1.0 KiB
Nix
Raw Normal View History

2024-07-12 15:53:54 +02:00
{ lib, pkgs, materusArg, config, ... }:
{
options.waffentragerService.syncthing.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable syncthing";
config =
let
cfg = config.waffentragerService.syncthing;
in
lib.mkIf cfg.enable {
waffentragerService.elements.enable = true; networking.firewall.allowedTCPPorts = [ 22000 config.services.syncthing.relay.statusPort config.services.syncthing.relay.port];
2024-07-12 15:53:54 +02:00
networking.firewall.allowedUDPPorts = [ 22000 21027 ];
2024-07-13 15:44:07 +02:00
systemd.services.syncthing = {
partOf = [ "elements-mount.service" ];
requires = [ "elements-mount.service" ];
after = [ "elements-mount.service" ];
};
2024-07-12 15:53:54 +02:00
services = {
syncthing = {
enable = true;
user = "materus";
group = "nextcloud";
2024-07-12 15:53:54 +02:00
dataDir = "${config.waffentragerService.elements.path}/storage/materus";
configDir = "${config.waffentragerService.elements.path}/storage/materus/Inne/Config/Syncthing/waffentrager/";
};
};
};
}