1
1
Fork 0

syncthings: no need for systemService option

This commit is contained in:
Tim Van Baak 2024-02-07 05:39:09 +00:00
parent 92b3d5c56e
commit db3df565d5
1 changed files with 3 additions and 11 deletions

View File

@ -496,14 +496,6 @@ in {
'';
};
systemService = mkOption {
type = types.bool;
default = true;
description = lib.mdDoc ''
Whether to auto-launch Syncthing as a system service.
'';
};
user = mkOption {
type = types.str;
default = defaultUser;
@ -622,7 +614,7 @@ in {
systemd.packages = [ pkgs.syncthing ];
users.users = mkIf (cfg.systemService && cfg.user == defaultUser) {
users.users = mkIf (cfg.user == defaultUser) {
${defaultUser} =
{ group = cfg.group;
home = cfg.dataDir;
@ -632,7 +624,7 @@ in {
};
};
users.groups = mkIf (cfg.systemService && cfg.group == defaultGroup) {
users.groups = mkIf (cfg.group == defaultGroup) {
${defaultGroup}.gid =
config.ids.gids.syncthing;
};
@ -640,7 +632,7 @@ in {
systemd.services = {
# upstream reference:
# https://github.com/syncthing/syncthing/blob/main/etc/linux-systemd/system/syncthing%40.service
syncthing = mkIf cfg.systemService {
syncthing = {
description = "Syncthing service";
after = [ "network.target" ];
environment = {