Merge pull request #48119 from mrVanDalo/update_syncthing

nixos/modules: services.syncthing add guiAddress parameter
This commit is contained in:
Peter Hoeg
2018-10-14 18:47:51 +08:00
committed by GitHub
@@ -16,6 +16,14 @@ in {
available on http://127.0.0.1:8384/. available on http://127.0.0.1:8384/.
''; '';
guiAddress = mkOption {
type = types.str;
default = "127.0.0.1:8384";
description = ''
Address to serve the GUI.
'';
};
systemService = mkOption { systemService = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@@ -23,7 +31,7 @@ in {
}; };
user = mkOption { user = mkOption {
type = types.string; type = types.str;
default = defaultUser; default = defaultUser;
description = '' description = ''
Syncthing will be run under this user (user will be created if it doesn't exist. Syncthing will be run under this user (user will be created if it doesn't exist.
@@ -32,7 +40,7 @@ in {
}; };
group = mkOption { group = mkOption {
type = types.string; type = types.str;
default = "nogroup"; default = "nogroup";
description = '' description = ''
Syncthing will be run under this group (group will not be created if it doesn't exist. Syncthing will be run under this group (group will not be created if it doesn't exist.
@@ -41,7 +49,7 @@ in {
}; };
all_proxy = mkOption { all_proxy = mkOption {
type = types.nullOr types.string; type = with types; nullOr str;
default = null; default = null;
example = "socks5://address.com:1234"; example = "socks5://address.com:1234";
description = '' description = ''
@@ -132,7 +140,12 @@ in {
User = cfg.user; User = cfg.user;
Group = cfg.group; Group = cfg.group;
PermissionsStartOnly = true; PermissionsStartOnly = true;
ExecStart = "${cfg.package}/bin/syncthing -no-browser -home=${cfg.dataDir}"; ExecStart = ''
${cfg.package}/bin/syncthing \
-no-browser \
-gui-address=${cfg.guiAddress} \
-home=${cfg.dataDir}
'';
}; };
}; };