fixed syncthing service to work as expected
This commit is contained in:
parent
7182ef35f4
commit
44788bb2ce
@ -36,9 +36,7 @@ in
|
|||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
default = "/var/lib/syncthing";
|
default = "/var/lib/syncthing";
|
||||||
description = ''
|
description = ''
|
||||||
Path where the `.syncthing` (settings and keys) and `Sync`
|
Path where the settings and keys will exist.
|
||||||
(your synced files) directories will exist. This can be your home
|
|
||||||
directory.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -57,18 +55,12 @@ in
|
|||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
environment.STNORESTART = "placeholder"; # do not self-restart
|
environment.STNORESTART = "placeholder"; # do not self-restart
|
||||||
environment.HOME = "${cfg.dataDir}";
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "${cfg.user}";
|
User = "${cfg.user}";
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
ExecStart = "${pkgs.syncthing}/bin/syncthing -home=${cfg.dataDir}/.syncthing";
|
ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -home=${cfg.dataDir}";
|
||||||
};
|
};
|
||||||
preStart = ''
|
|
||||||
mkdir -p ${cfg.dataDir}
|
|
||||||
chown ${cfg.user} ${cfg.dataDir}
|
|
||||||
'';
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.syncthing ];
|
environment.systemPackages = [ pkgs.syncthing ];
|
||||||
|
Loading…
Reference in New Issue
Block a user