aboutsummaryrefslogblamecommitdiff
path: root/modules/services/syncthing/default.nix
blob: ea8c4d6fd3f14d40208864f757924b025b435650 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
                           


                                     
    







                                                
                     
                      


                                                     
      

    
{ config, pkgs, lib, ... }:
let
  cfg = config.my.services.syncthing;
  secrets = config.age.secrets;
in {
  options.my.services.syncthing = with lib; {
    enable = mkEnableOption "syncthing service";
  };

  config = lib.mkIf cfg.enable {
    services.syncthing = {
      enable = true;
      openDefaultPorts = true;
      user = "fcuny";
      group = "users";
      dataDir = "/home/fcuny/.local/state/syncthing";
      cert = secrets."syncthing/cert".path;
      key = secrets."syncthing/key".path;
    };
  };
}