config

NixOS config
Log | Files | Refs | README | LICENSE

default.nix (539B) - Raw


      1 { config, lib, ... }:
      2 let
      3   cfg = config.mj.services.syncthing-relay;
      4 in
      5 {
      6   options.mj.services.syncthing-relay = with lib.types; {
      7     enable = lib.mkEnableOption "enable syncthing-relay";
      8   };
      9 
     10   config = lib.mkIf cfg.enable {
     11     services.syncthing.relay = {
     12       enable = true;
     13       providedBy = "jakstys.lt";
     14     };
     15     systemd.services.syncthing-relay.restartIfChanged = false;
     16 
     17     networking.firewall.allowedTCPPorts = [
     18       config.services.syncthing.relay.port
     19       config.services.syncthing.relay.statusPort
     20     ];
     21   };
     22 
     23 }