fixed syncthing service to work as expected

authored by Enrico Fasoli and committed by Rok Garbas 44788bb2 7182ef35

+2 -10
+2 -10
nixos/modules/services/networking/syncthing.nix
··· 36 dataDir = mkOption { 37 default = "/var/lib/syncthing"; 38 description = '' 39 - Path where the `.syncthing` (settings and keys) and `Sync` 40 - (your synced files) directories will exist. This can be your home 41 - directory. 42 ''; 43 }; 44 ··· 57 after = [ "network.target" ]; 58 wantedBy = [ "multi-user.target" ]; 59 environment.STNORESTART = "placeholder"; # do not self-restart 60 - environment.HOME = "${cfg.dataDir}"; 61 serviceConfig = { 62 User = "${cfg.user}"; 63 PermissionsStartOnly = true; 64 Restart = "always"; 65 - ExecStart = "${pkgs.syncthing}/bin/syncthing -home=${cfg.dataDir}/.syncthing"; 66 }; 67 - preStart = '' 68 - mkdir -p ${cfg.dataDir} 69 - chown ${cfg.user} ${cfg.dataDir} 70 - ''; 71 - 72 }; 73 74 environment.systemPackages = [ pkgs.syncthing ];
··· 36 dataDir = mkOption { 37 default = "/var/lib/syncthing"; 38 description = '' 39 + Path where the settings and keys will exist. 40 ''; 41 }; 42 ··· 55 after = [ "network.target" ]; 56 wantedBy = [ "multi-user.target" ]; 57 environment.STNORESTART = "placeholder"; # do not self-restart 58 serviceConfig = { 59 User = "${cfg.user}"; 60 PermissionsStartOnly = true; 61 Restart = "always"; 62 + ExecStart = "${pkgs.syncthing}/bin/syncthing -no-browser -home=${cfg.dataDir}"; 63 }; 64 }; 65 66 environment.systemPackages = [ pkgs.syncthing ];