Files
sydnix/modules/nixos/syncthing.nix
2025-02-09 01:32:05 -07:00

36 lines
733 B
Nix

{ config, lib, pkgs, ... }:
let cfg = config.sydnix.syncthing;
in {
options = {
sydnix.syncthing = {
enable = lib.mkEnableOption "Syncthing";
devices = lib.mkOption {
type = lib.types.anything;
default = {};
};
folders = lib.mkOption {
type = lib.types.anything;
default = {};
};
};
};
config = lib.mkIf cfg.enable {
users.users.${config.services.syncthing.user}.extraGroups = [
"jellyfin"
];
services.syncthing = {
enable = true;
openDefaultPorts = true;
settings = {
overrideDevices = true;
overrideFolders = true;
devices = cfg.devices;
folders = cfg.folders;
};
};
};
}