@@ -88,7 +88,7 @@ in
8888 use <literal>systemctl start btsync@user</literal> to start
8989 the daemon only for user <literal>user</literal>, using the
9090 configuration file located at
91− <literal>$HOME/.config/btsync.conf</literal>
91+ <literal>$HOME/.config/btsync.conf</literal>.
9292 '';
9393 };
9494
@@ -223,6 +223,21 @@ in
223223 --generate-secret</literal>. Note that this secret will be
224224 put inside the Nix store, so it is realistically not very
225225 secret.
226+
227+ If you would like to be able to modify the contents of this
228+ directories, it is recommended that you make your user a
229+ member of the <literal>btsync</literal> group.
230+
231+ Directories in this list should be in the
232+ <literal>btsync</literal> group, and that group must have
233+ write access to the directory. It is also recommended that
234+ <literal>chmod g+s</literal> is applied to the directory
235+ so that any sub directories created will also belong to
236+ the <literal>btsync</literal> group. Also,
237+ <literal>setfacl -d -m group:btsync:rwx</literal> and
238+ <literal>setfacl -m group:btsync:rwx</literal> should also
239+ be applied so that the sub directories are writable by
240+ the group.
226241 '';
227242 };
228243 };
@@ -246,14 +261,20 @@ in
246261 home = "/var/lib/btsync";
247262 createHome = true;
248263 uid = config.ids.uids.btsync;
264+ group = "btsync";
249265 };
250266
267+ users.extraGroups = [
268+ { name = "btsync";
269+ }];
270+
251271 systemd.services.btsync = with pkgs; {
252272 description = "Bittorrent Sync Service";
253273 wantedBy = [ "multi-user.target" ];
254274 after = [ "network.target" ];
255275 serviceConfig = {
256276 Restart = "on-abort";
277+ UMask = "0002";
257278 User = "btsync";
258279 ExecStart =
259280 "${bittorrentSync}/bin/btsync --nodaemon --config ${configFile}";