diff --git a/nixos/modules/services/networking/syncthing.nix b/nixos/modules/services/networking/syncthing.nix index 2e92fe51e90a..d77562701492 100644 --- a/nixos/modules/services/networking/syncthing.nix +++ b/nixos/modules/services/networking/syncthing.nix @@ -9,7 +9,7 @@ let devices = mapAttrsToList (name: device: { deviceID = device.id; - inherit (device) name addresses introducer; + inherit (device) name addresses introducer autoAcceptFolders; }) cfg.devices; folders = mapAttrsToList ( _: folder: { @@ -149,6 +149,15 @@ in { ''; }; + autoAcceptFolders = mkOption { + type = types.bool; + default = false; + description = '' + Automatically create or share folders that this device advertises at the default path. + See . + ''; + }; + }; })); }; @@ -425,6 +434,15 @@ in { defaultText = literalExample "dataDir${optionalString cond " + \"/.config/syncthing\""}"; }; + extraFlags = mkOption { + type = types.listOf types.str; + default = []; + example = [ "--reset-deltas" ]; + description = '' + Extra flags passed to the syncthing command in the service definition. + ''; + }; + openDefaultPorts = mkOption { type = types.bool; default = false; @@ -517,7 +535,7 @@ in { ${cfg.package}/bin/syncthing \ -no-browser \ -gui-address=${cfg.guiAddress} \ - -home=${cfg.configDir} + -home=${cfg.configDir} ${escapeShellArgs cfg.extraFlags} ''; MemoryDenyWriteExecute = true; NoNewPrivileges = true;