Merge pull request #47526 from rnhmjoj/syncthing
nixos/syncthing: move configuration to condigDir
This commit is contained in:
commit
2dc0fc6516
@ -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>
|
||||||
|
@ -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}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user