Merge pull request #47526 from rnhmjoj/syncthing

nixos/syncthing: move configuration to condigDir
This commit is contained in:
Joachim F 2018-11-02 12:02:51 +00:00 committed by GitHub
commit 2dc0fc6516
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -97,6 +97,16 @@
start org.nixos.nix-daemon</command>. start org.nixos.nix-daemon</command>.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
The Syncthing state and configuration data has been moved from
<varname>services.syncthing.dataDir</varname> to the newly defined
<varname>services.syncthing.configDir</varname>, which default to
<literal>/var/lib/syncthing/.config/syncthing</literal>.
This change makes possible to share synced directories using ACLs
without Syncthing resetting the permission on every start.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</listitem> </listitem>
<listitem> <listitem>

View File

@ -62,9 +62,21 @@ in {
dataDir = mkOption { dataDir = mkOption {
type = types.path; type = types.path;
default = "/var/lib/syncthing"; default = "/var/lib/syncthing";
description = ''
Path where synced directories will exist.
'';
};
configDir = mkOption {
type = types.path;
description = '' description = ''
Path where the settings and keys will exist. Path where the settings and keys will exist.
''; '';
default =
let
nixos = config.system.stateVersion;
cond = versionAtLeast nixos "19.03";
in cfg.dataDir + (optionalString cond "/.config/syncthing");
}; };
openDefaultPorts = mkOption { openDefaultPorts = mkOption {
@ -144,7 +156,7 @@ in {
${cfg.package}/bin/syncthing \ ${cfg.package}/bin/syncthing \
-no-browser \ -no-browser \
-gui-address=${cfg.guiAddress} \ -gui-address=${cfg.guiAddress} \
-home=${cfg.dataDir} -home=${cfg.configDir}
''; '';
}; };
}; };